Skip to content

Tracking: PMTiles parity with GeoLibre #557

Open

Description

@giswqs

RustGIS reads PMTiles v3 archives (raster and vector, desktop file or web address by range requests, in the browser too) and draws them with the built-in or a per-layer style. GeoLibre does more with them. This issue tracks closing the gap, one pull request per item. Part of #77.

Reading and navigation

Querying

Source layers and styling

  • Source layers in Contents: the archive's vector_layers listed under the tile layer, each with its own visibility
  • Style each source layer in the Format pane: fill, stroke, width, point size and opacity, kept with the project (map.setTiles able to change layers/styleLayers)
  • Filters and legend swatches for vector tile source layers

Basemaps

  • A PMTiles archive as a basemap with flavours (light, dark, white, grayscale, black) for Protomaps-schema archives, from a URL or a local file. The flavours are our own styles, drawn for RustGIS (no third-party styles, see AGENTS.md)

Creating archives

  • Vector to PMTiles: a geoprocessing tool writing a layer as vector tiles (MVT) in a PMTiles archive, zoom range chosen (feat(tiles): export vector layers to PMTiles #1006)
  • Raster to PMTiles: a raster layer as PNG/WebP tiles in a PMTiles archive (band, colour map, resampling, zoom range)
  • PMTiles Extract / offline basemap: an area and zoom range cut out of a remote archive (e.g. a planet build) over range requests into a local .pmtiles, then added as a basemap or overlay

Python

Not planned

  • AVIF tiles: needs a C decoder (dav1d) and would break the pure-Rust and wasm rules
  • PMTiles v2 archives: GeoLibre does not read them either

Activity

  1. choupeanut commented on Oct 25, 2026

    @choupeanut
    Contributor

    I'm taking the Python item only: add Map.add_pmtiles(url, name=…, source_layers=…, style=…) through the existing map.addTiles command, shared with Session. I'll preserve the existing tile styling and widget synchronization behavior, add offline Python regression tests and docs, and introduce no dependencies or command/project format changes. The remaining parity items stay open.

  2. deniial00 commented on Oct 28, 2026

    @deniial00
    Member

    I'd like to take Source layers in Contents next. Here's the plan. It adds one optional project field and one optional map.setTiles parameter, so per CONTRIBUTING ("Coordinate first") I'll wait for a go-ahead before writing much code.

    What the user sees
    A vector PMTiles or MBTiles tile layer in the Layers pane gets the expand chevron (it shows today only for layers with legends). Expanded, it lists the archive's vector_layers under the tile row, each with a visibility checkbox. A layer that has legends as well shows both. Unticking a source layer hides its fills, lines, points and labels, and identify and pop-ups skip it. The choice is kept with the project and can be undone.

    Commands and model

    • TileLayer.hidden_layers: Vec<String> (hiddenLayers in the project, left out when empty): the source layers switched off. Older projects open unchanged.
    • map.setTiles gains "hiddenLayers"?: [name], which replaces the hidden set (names are trimmed, deduplicated and capped). The Layers pane checkboxes dispatch it, so the CLI, Python, the Assistant and MCP get it too.
    • map.tiles lists sourceLayers (the archive's names, once its metadata is in) and hiddenLayers for each vector archive.
    • No new command, no ribbon change, no dependency.

    How it draws
    rustgis_tiles::source::Spec gets hidden_layers. It is part of Spec::key(), and resolve drops the style layers whose source-layer is hidden. Every consumer of the resolved style follows from that one change: CPU drawing, the picture cache, GPU meshes (keyed by the resolved style) and draw::pick for identify. This holds for the built-in look, the named-layer look and custom styleLayers alike.

    Tests and docs

    • tiles: resolving with a hidden set drops just those style layers, and the key differs.
    • engine: a PMTiles archive built in code with two source layers. map.tiles lists both; hiding one leaves its features out of identify; the setting survives a project round trip and undoes. Bad hiddenLayers values are refused, and hostile_params_never_panic stays green.
    • ui-egui: a harness test that ticks a source-layer checkbox, plus a ui_shot before/after screenshot for the PR.
    • Docs: docs/user-guide/maps.md (tile layers in the Layers pane).

    Out of scope here: per-source-layer styling, filters and legend swatches (the next two items), and TileJSON/OGC vector tile layers.

  3. choupeanut commented on Oct 29, 2026

    @choupeanut
    Contributor

    I will take the Raster to PMTiles item. I will reuse the existing raster renderer and PMTiles writer to export styled Web Mercator PNG tiles at a chosen zoom range, with bounded work, no new dependencies and regression coverage for archive contents and invalid inputs. This is separate from the source-layer visibility work already in progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions