Skip to content

Proposal for maps extension - #1

Open
m-mohr wants to merge 3 commits into
mainfrom
proposal
Open

m-mohr wants to merge 3 commits into
mainfrom
proposal

Conversation

@m-mohr

@m-mohr m-mohr commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@emmanuelmathot emmanuelmathot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @m-mohr , this is a solid base and very close to what we discussed. Overall structure looks right to me. Some points in sub comments/suggestions

Comment thread README.md Resolved
Comment thread README.md Resolved
Comment thread README.md Resolved
Comment thread README.md Resolved
Comment thread README.md Resolved
Comment thread README.md Resolved
Comment thread README.md Resolved
Comment thread README.md Resolved
Comment thread json-schema/schema.json Resolved
Comment thread json-schema/schema.json Resolved
@emmanuelmathot

This comment was marked as outdated.

@m-mohr

This comment was marked as outdated.

@jo-chemla

Copy link
Copy Markdown

Hi there, great to see this proposal and its split from the render extension, so that a catalog can tell its consumers how to render its data. Seems a bit similar in spirit to STAC Browser's asset and link actions, which tell which interactive online viewer can open which formats, here for map data.

I tried it on a real catalog: a survey of ~1,000 heritage inventories (national and regional) plus weekly OpenStreetMap and Wikidata exports, as a static STAC catalog that is also served through stac-fastapi-pgstac.

The experiment below and the implementation of the draft spec were done with help from Claude Fable 5.2.

Most of these sources are services: ArcGIS REST (FeatureServer, MapServer), WFS, WMS, vector tiles through a TileJSON, PMTiles, OGC API Features, SPARQL, JSON APIs, etc. Only 26 collections use web map links a client can draw: WMS, TileJSON and PMTiles. The web-map-links v2 draft (web-map-links#31, opened 2026-11-09) covers WMS, WMTS, XYZ, TileJSON, PMTiles and 3D Tiles. ArcGIS REST and WFS would be the next candidates: my FeatureServer links already use the arcgis-featureserver rel and featureserver:layers of web-map-links#27, while the MapServer and WFS links use a rel and fields of my own until web-map-links covers them (see web-map-links#8).

Where maps helped is vector tiles: nothing tells a client that a TileJSON or PMTiles link holds vector data, nor how to draw it. On my catalog:

  • STAC Browser 5.2 requests the .pbf tiles of a vector TileJSON as images, so nothing shows. It draws the first of my two PMTiles links in OpenLayers' default style, and shows maps as plain metadata.
  • stac-map loads a TileJSON as raster and does not read PMTiles. I opened stac-map#586 so that it draws a vector TileJSON with the layers of a stylesheet link. It does not read maps yet.

With maps, each layer gets its MapLibre style as a stylesheet link, which says "this is data, draw it like this":

All 31 documents that use maps (15 collections, the same 15 sources as items in the API, where maps sits in the item's properties, and the catalog) validate against this PR's json-schema/schema.json, both the static files and as the API serves them: pgstac keeps maps and the link ids as they are.

Questions that came up:

  1. A MapLibre style declares its own sources. Mine has one vector source pointing at the same file as the layer's link (the TileJSON, or the archive as pmtiles://…). Should the spec say how a stylesheet binds to the layer's source? stac-map#586 keeps the style's layers whose source-layer is one of the TileJSON's vector_layers and puts them on the link's source, ignoring the style's own. Without a rule, the two can disagree.
  2. In four of the collections the style was already an asset (roles: ["style"]), and I added the same file as a stylesheet link only so that a layer can reference it. Could style also take {"asset": "<key>"}?
  3. A catalog's map cannot reference its collections' links (ids are looked up in the document, then in the parent Collection), so my catalog repeats the four PMTiles and stylesheet links of its collections as embedded links. Is that the intended way?
  4. Are relative hrefs in embedded links resolved against the document, like other links? The collections' own links are relative (./tilejson.json, ./style.json); I made the embedded ones absolute to be safe.
  5. A minor one: for planet-wide tiles, a range in ground metres moves with latitude. My "outlines from zoom 13" (9.555 m at the equator) applies from about zoom 12.4 at 48° N. Fine for me; is a zoom-based range out of scope on purpose?

m-mohr and others added 2 commits November 27, 2026 22:36
Co-authored-by: Emmanuel Mathot <1178857+emmanuelmathot@users.noreply.github.com>
@m-mohr

m-mohr commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

@emmanuelmathot Thanks for the review, I've applied changes mostly as suggested. Please check again.

@jo-chemla Thanks for trying this on a real catalog!

  1. Added in the last commit: the layer's source replaces the stylesheet's sources, and only style layers whose source-layer exists in the data are applied. A complete map in a stylesheet can be linked directly, but not used as a layer style.
  2. Added in the last commit, too: a style can also be an asset ({"asset": "<key>"}, role style).
  3. Yes, intended. Maps only reference their own document. For reuse across documents chime in here: Collection-level maps as templates for Items (item_maps) #4
  4. Like any link, see https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#use-of-links
  5. It's intentional, zoom levels differ between libraries and tiling schemes, see also minmax_zoom leads to different results for mapping libraries render#16

I opened an issue in STAC Browser for your points: radiantearth/stac-browser#1093

@m-mohr
m-mohr marked this pull request as ready for review November 27, 2026 21:57

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants