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

crs check now acceps versions in crs-string #721

Merged
merged 8 commits into from
Oct 9, 2023
Merged

crs check now acceps versions in crs-string #721

merged 8 commits into from
Oct 9, 2023

Conversation

Gigaszi
Copy link
Contributor

@Gigaszi Gigaszi commented Oct 3, 2023

Corresponding issue

Closes #716

Checklist

  • I have updated my branch to main (e.g. through git rebase main)
  • My code follows the style guide and was checked with pre-commit before committing
  • I have commented my code
  • I have added sufficient unit and integration tests
  • I have updated the CHANGELOG.md

Please check all finished tasks. If some tasks do not apply to your PR, please cross their text out (by using ~...~) and remove their checkboxes.

crs = bpolys.get("crs", None)
if crs is None:
pass
elif "urn:ogc:def:crs:OGC::CRS84" in crs["properties"]["name"]:
elif re.match(
r"urn:ogc:def:crs:OGC:\d+(\.\d+)*:CRS84",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would fnmatch suffice? It would be easier to read: https://stackoverflow.com/questions/11427138/python-wildcard-search-in-string

@matthiasschaub
Copy link
Collaborator

Could you add a test case?

@matthiasschaub
Copy link
Collaborator

Add test case for urn:ogc:def:crs:EPSG::4326. This should not raise error.

@Gigaszi Gigaszi merged commit cede999 into main Oct 9, 2023
2 checks passed
@Gigaszi Gigaszi deleted the crs-validation branch October 9, 2023 08:15
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.

CRS validation does not cover every valid case and raises an exception unexpectably
2 participants