Skip to content

feat(crs): accept EPSG:xxxx shorthand in the crs query parameter - #2431

Open
C1-BA-B1-F3 wants to merge 5 commits into
geopython:masterfrom
C1-BA-B1-F3:fix/crs-abbreviations
Open

C1-BA-B1-F3 wants to merge 5 commits into
geopython:masterfrom
C1-BA-B1-F3:fix/crs-abbreviations

Conversation

@C1-BA-B1-F3

Copy link
Copy Markdown
Contributor

Summary

The crs query parameter only accepted the full URI form:

?crs=http://www.opengis.net/def/crs/EPSG/0/28992

The common shorthand ?crs=EPSG:28992 was rejected with CRS 'EPSG:28992' not supported for this collection, even though it denotes the same CRS.

Fix

Add normalize_crs_uri which converts an EPSG:xxxx shorthand to the canonical URL before matching against the supported-CRS list. Non-EPSG inputs (URNs, URLs, custom identifiers) pass through unchanged.

normalize_crs_uri('EPSG:28992')
# 'http://www.opengis.net/def/crs/EPSG/0/28992'

normalize_crs_uri('urn:ogc:def:crs:EPSG::28992')
# 'urn:ogc:def:crs:EPSG::28992'  (unchanged)

Test plan

  • Unit assertions for EPSG shorthand (upper/lower case), URL, URN, and non-EPSG inputs.

Fixes #2375

PostgreSQL and MongoDB managers ignored the limit and offset
parameters, returning all jobs regardless of the query string.

Apply offset before limit in both backends, matching the existing
TinyDB behaviour.

Fixes geopython#2426
…ints

The tilematrixsets and tilematrixset HTML handlers passed api.tpl_config
as the template configuration, but that dict carries the full server
config (including 'server') and lacks the 'path' key that
render_j2_template expects. The lookup therefore always fell back to
the default templates, ignoring any custom theme.

Pass api.config['server']['templates'] instead, matching every other
render_j2_template call site.

Fixes geopython#2422
…DBAPI

A provider configured with a bare connection string (e.g.
"postgresql://user@host/db") resolved to SQLAlchemy's default DBAPI
for that backend — psycopg (v3) for PostgreSQL. Deployments that only
install psycopg2 then fail with 'ModuleNotFoundError: No module named
psycopg' even though the provider pins 'postgresql+psycopg2'.

When the caller's URL has no '+driver' suffix and the provider's
driver_name does, rewrite the URL's drivername to the pinned one.

Fixes geopython#2424
…bsent

The MapScript provider only read options.projection, ignoring the
documented storage_crs configuration. Deployments that set storage_crs
(like every other provider) silently got EPSG:4326, producing empty
images for data in any other projection.

Use storage_crs when options.projection is not set; the legacy
options.projection override still wins when present so existing
workarounds keep working.

Fixes geopython#2400
The crs parameter only accepted the full URI form
(http://www.opengis.net/def/crs/EPSG/0/28992); the common shorthand
EPSG:28992 was rejected with 'CRS not supported for this collection'.

Normalize an EPSG:xxxx query parameter to the canonical URL before
matching against the supported-CRS list, so both forms work.

Fixes geopython#2375

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.

enable crs abbreviations

1 participant