-
Notifications
You must be signed in to change notification settings - Fork 41
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 epsg-code to be provided as string? #259
Comments
The Equi7 requires the following string to be parsed for using it in load_collection |
Is that a client or a server issue, @clausmichele ? |
Well, the question is: how does the client understand if the provided value is an integer referring to a crs code, an epsg code string or a WKT string? |
Does the client need to understand it? Usually, it just needs to be passed through to the server, no? |
Yes, but from this issue https://github.com/openEOPlatform/architecture-docs/issues/159#issuecomment-978126164 it seemed that the plan was to convert an EPSG string to the integer representing it client side, since the API requires a crs to be specified as an integer. |
Oh, I see... well you can easily distinguish them, see the pseudo-code below for an example:
or just do the following to convert epsg strings to int and pass the rest through:
|
It would be great to get this small convenience into the Python client as all other clients already handle it smoothly: |
merged |
Reopening this issue: merged PR #453 introduced a new runtime dependency However, pyproj is not a pure python lib, for which we have to be extra careful to add as runtime dependency. I think we can extend PR #453 to make this an optional dependency |
- rename to `normalize_crs` because it is not only about EPSG output, WKT2 output is also allowed - reworked and simplified pyproj availability handling: when available: use it fully, when not: do best effort normalization - Move tests into class for better grouping and overview - add test coverage for "no pyproj available" code path
resolved now, issue can be closed again |
The specification asks to provide EPSG codes as numbers (e.g. 4326 instead of EPSG:4326). We see many code snippets that actually use the string variant, which strictly speaking should be WKT2.
So an idea coming up in recent discussions is that we use the clients to correct this common mistake.
So for subtype
epsg-code
a client could simply match against the pattern/regexp/^EPSG:(\d{4,})$/i
and replace it with the first match converted to an int.In pseudo-code something like:
The text was updated successfully, but these errors were encountered: