[Feature]: A mask for tile layers (WMS, XYZ…), as layer.mask gives feature and raster layers
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust, web-dev
- Domain
- backend-api-design, databases, frontend
Research direction
Start by tracing map.setTiles, map.addTiles, and service.add, then compare how feature and raster layers implement masking. Follow the tile drawing, project save and removal, properties UI, identify, render, and export paths named in the proposal. Done means all listed commands and UI support masks, outside pixels are omitted in view and export, clearing and removing a mask behave as specified, and the tests pass.
Written by the indexing model from the issue text.
Description
Before you start
- I searched the existing issues and the roadmap and did not find a duplicate request.
What problem does this solve?
A tile layer (XYZ, WMS, WMTS, ArcGIS map service) can't be cut to a polygon. layer.mask takes a polygon layer and masks a feature or raster layer, but a tile layer isn't a layer it can be given (map.addTiles and map.setTiles have no mask), so a WMS map of a country or of the world always draws everywhere.
A study area's map then shows the service's picture outside the area too, while every other layer of the area is cut to it. There is no workaround inside RustGIS:
- A WMS
GetMappicture can't be opened as a raster, so it can't be clipped.layer.addUrlon a PNGGetMapaddress answers "not a data format RustGIS reads". - Many services offer no GeoTIFF
GetMap, and no WCS of the same product.
Proposed solution
A mask on a tile layer, as feature and raster layers have: the tile layer draws only inside the polygons of a polygon layer.
Choices in this proposal
- Commands:
map.setTilestakes"mask": polygon layer | null, aslayer.maskdoes;map.addTilesandservice.addtake it too, so a layer can be added already cut.
- Drawing: the same as
layer.maskfor a raster, applied to the tile layer's drawn picture: its pixels outside the mask's polygons are left out. Map view, layouts and exports all draw it this way. - Saved: the mask is kept in the project with the tile layer, by the mask layer's id, and handled as a feature or raster layer's mask is when that layer is removed.
- UI: the tile layer's properties get the Masking choice that feature and raster layers have.
- Identify: a click outside the mask doesn't ask a WMS layer for its feature info.
- Tests:
- a tile layer masked by a polygon draws nothing outside it, both in a render and in an export;
"mask": nullremoves the mask;- removing the mask layer leaves the tile layer as a raster's mask leaves its layer.
Alternatives considered
- Veil: a polygon with a hole for the area, drawn over the tiles in the paper's colour. It also hides the basemap and other layers outside the area, and it has to be kept above the tiles by hand.
- Clip the service's data: only possible where the service offers a GeoTIFF or a WCS, which the drought maps of the Copernicus Global Drought Observatory, for one, don't (their WCS gives colour classes, and not every product).
Additional context
This came up in the BrasilData plugin, which adds the Copernicus Global Drought Observatory's drought maps (WMS) over a study area. Every other BrasilData layer is clipped to the area, and the drought map is not.
- Dominant language
- Rust
- Stars
- 1.9k
- Forks
- 268
- Avg merge
- 11h 1m
- Merged PRs (30d)
- 942
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from opengeos/RustGIS
-
[Bug]: layer.move to the place a layer already has fails and stops a script; with several layers it leaves an empty undo stepPossibly taken @jgregoriorincon claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opengeos/RustGIS#2621 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
opengeos/RustGIS#1446 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
All issues in opengeos/RustGIS
Similar issues
-
postgresql-rules / queue-rules: implicit KEY SHARE before a parent key update, and job self-overlapOpen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jonathanong/no-mistakes#3879 ·
Maintainers usually reply within 1 day
-
area:index v0.35.0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
nautechsystems/nautilus_trader#5741 ·
Maintainers usually reply within 1 day
-
RunPlugin derives Hash over all fields while PartialEq compares only location and configurationOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
zellij-org/zellij#5969 ·
Maintainers usually reply within 1 day
-
eth_get_proof reports another account's fields for an absent accountPossibly taken @Indian-boult claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day