Skip to content

Updates to the OGC API - Maps Support#2308

Draft
doublebyte1 wants to merge 4 commits intogeopython:masterfrom
doublebyte1:map-updates
Draft

Updates to the OGC API - Maps Support#2308
doublebyte1 wants to merge 4 commits intogeopython:masterfrom
doublebyte1:map-updates

Conversation

@doublebyte1
Copy link
Copy Markdown
Contributor

@doublebyte1 doublebyte1 commented Mar 30, 2026

Overview

  • Introduced some guardrails for WebMercator, to prevent issues with out of bounds.
  • Since the WMS Facade does not support a bbox-crs different than the crs, there is no need to pass a bbox-crs to the provider; however we must ensure that we always pass the bbox in crs coordinates (transform, if needed).
  • Support default values for crs, bbox-crs and bbox (read from extent); make sure that the combination of a missing crs and missing spatial extent defaults to 4326;
  • Turn an invalid crs to 4326;

This PR also addresses a current issue with the map preview on the collection page, which affects the demo server.

Additional information

Collection preview of the maps provider:

Screenshot from 2026-03-31 09-14-21 Screenshot from 2026-03-31 09-14-34

TODOS:

  • update unit tests
  • update docs

Dependency policy (RFC2)

  • I have ensured that this PR meets RFC2 requirements

Updates to public demo

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution
  • I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

…e WebMercator bbox

- Support defaults for crs, bbox and bbox-crs
@doublebyte1 doublebyte1 marked this pull request as draft March 30, 2026 17:56
@webb-ben
Copy link
Copy Markdown
Member

Should the bbox-crs not be used to convert the bbox into the requested crs?

@doublebyte1
Copy link
Copy Markdown
Contributor Author

doublebyte1 commented Mar 31, 2026

Should the bbox-crs not be used to convert the bbox into the requested crs?

Whenever it exists, yes; but this is an optional parameter, so we should have a fallback if we want to support a minimal map query (e.g.: no crs, no bbox-crs, no bbox).

https://github.com/doublebyte1/pygeoapi/blob/b581b8cd93bf8691a5adee34c7ce8fd425784ae0/pygeoapi/api/maps.py#L120-129

@webb-ben
Copy link
Copy Markdown
Member

Makes some sense to me. Is there a reason to derive the default CRS from bbox or should we align this with crs list and storage_crs as implemented for OAFeat?

@doublebyte1
Copy link
Copy Markdown
Contributor Author

Makes some sense to me. Is there a reason to derive the default CRS from bbox or should we align this with crs list and storage_crs as implemented for OAFeat?

If we don' t have bbox-crs and bbox as parameters, we still need some defaults to provide a map to the user. The defaults are taken from what is defined on the spatial extents of the collections (bbox and bbox-crs), but I am open to more ideas (:

Examples:
https://demo.pygeoapi.io/master/collections/mapserver_world_map/map?f=png&crs=4326
https://demo.pygeoapi.io/master/collections/mapserver_world_map/map?f=png

If the spatial extents of the collection are not defined in the config, I also defined some defaults. But I am actually not sure, if that is even possible?

In the case of our WMS providers, the storage_crs make less sense, because they are basically facades.

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.

2 participants