Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow multiple OGC_SRS synonyms for WebMaps #2138

Merged
merged 2 commits into from
Feb 22, 2023

Conversation

raphaelquast
Copy link
Contributor

@raphaelquast raphaelquast commented Feb 21, 2023

Rationale

Another fix I noticed related to WebMap services.
(@dopplershift I know it would have been better to already add this in #2136 but you were too fast in merging 😅 )

At the moment the identification of OGC_SRS identifiers is done via the
_CRS_TO_OGC_SRS dict which is structured as follows: {projection : "EPSG----"}

This however creates a problem if multiple codes exist, which is especially true for the most commonly used WebMercator projection, e.g:

  • 900913 (outdated but still sometimes used and at the moment the only hardcoded synonym for ccrs.GOOGLE_MERCATOR)
  • 3857 (the actual epsg code for the projection (see osm-wiki)

This pull-request changes the definition for _CRS_TO_OGC_SRS to use lists (so that multiple synonyms can be provided), and implements the necessary changes in the functions that use _CRS_TO_OGC_SRS.

In addition the check is now done based on lower-case strings to avoid issues with WebMaps that use epsg:--- instead of EPSG:----.

Implications

  • WebMap services provided with a SRS identifiers EPSG:3857 now work as expected.
  • WebMaps using lower-case SRS identifiers now also work as expected (e.g. "epsg:----")

lib/cartopy/io/ogc_clients.py Outdated Show resolved Hide resolved
lib/cartopy/io/ogc_clients.py Outdated Show resolved Hide resolved
@dopplershift dopplershift merged commit 91f89be into SciTools:main Feb 22, 2023
@QuLogic QuLogic added this to the 0.21.2 milestone Feb 22, 2023
@greglucas greglucas modified the milestones: 0.21.2, 0.22 Jul 26, 2023
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.

5 participants