Repository navigation
Description
Before you start
- I searched the existing issues and the roadmap and did not find a duplicate request.
What problem does this solve?
There's no way to save what a WMS, WMTS or XYZ tile layer shows as a raster with coordinates.
- Export Raster (
share.exportRaster) refuses these layers with "select a raster layer in the Layers pane first". Its check needs a layer that holds pixel data, and a tile or WMS layer is drawn on request, with nothing loaded to write. - Export Map (
share.exportMap) draws the view, these layers included, but writes only a PNG. It has no world file and no GeoTIFF tags, so the image has no coordinates. - Download Map takes features offline, not tiles.
Today's workarounds:
- a WCS endpoint, where the provider has one, gives a GeoTIFF layer (EPSG:4326, at most 2048 px a side);
- or export a PNG, add it back, place it by hand with Georeference, then export it again. That's slow and only approximate.
A georeferenced image of a basemap or WMS map is useful as an offline backdrop, as input to digitizing or classification, or to hand to another GIS.
Proposed solution
Two parts, which could land separately.
1. Export Map as GeoTIFF (the map view). share.exportMap takes a .tif path as well as .png. It draws the view as now, with the same width, height and DPI options, and writes RGBA as a GeoTIFF in the map's CRS:
- a geotransform from the view's extent and the image size;
- the CRS in the GeoKeys.
The map may be rotated, which a north-up geotransform can't hold, so a rotated view is refused with a message (or drawn unrotated). Labels, scale bar and credits are left off: they are map furniture, not data. A cheaper first step is a world file (.pgw) plus .prj beside the PNG.
2. Export a tile or WMS layer as a raster (one layer). Export Raster accepts a WMS, WMTS or XYZ layer and writes that layer alone, over the view's extent or an extent the user gives:
- at a resolution the user picks, or by default the tile zoom the view shows;
- a WMTS or XYZ layer is put together from its tiles at that zoom, in the tiles' CRS (usually EPSG:3857), not warped;
- a WMS layer is fetched as GetMap requests in the asked CRS, split into blocks when the image is larger than the server's
MaxWidth/MaxHeight.
It writes RGB(A) GeoTIFF or COG through the writer Export Raster already uses (write_geotiff), on the export thread with progress and Cancel like the other exports (#1291).
Both parts should ask for and keep the layer's credits, for example in a TIFFTAG_COPYRIGHT or ImageDescription tag. Part 2 should cap the tile count and say why it refuses. Many tile services' terms forbid bulk download (OSM's tile usage policy, for one), and a large area at a high zoom is thousands of requests.
As a command:
share.exportMap {"path": "view.tif", "width": 4096}
share.exportRaster {"layer": "swisstopo", "path": "area.tif", "bbox": [...], "zoom": 16}
Estimated scope
Medium: a broader feature that is feasible in a reasonable timeframe
Alternatives considered
- WCS, where a service offers it. Few basemap services do.
- Manual georeferencing of an exported PNG (see above).
- GDAL's WMS/TMS driver (
gdal_translateon a WMS XML) outside RustGIS.
Activity
pick2510 commentedon Nov 7, 2026
I'll take this one, starting with part 1 (Export Map as GeoTIFF).
feat(share): Export Map writes the view as a GeoTIFF placed on the gr…
feat(share): Export Map writes the view as a GeoTIFF placed on the gr…
feat(share): Export Raster writes a tile layer's tiles as a GeoTIFF (#…
pick2510 commentedon Nov 9, 2026
Done in two parts:
One difference from the proposal: a WMS layer is exported through the Web Mercator tiles the map already uses, not as GetMap requests in another CRS. If that's needed, it can be a follow-up.