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

EPSG code as string #391

Closed
m-mohr opened this issue Oct 12, 2022 · 4 comments
Closed

EPSG code as string #391

m-mohr opened this issue Oct 12, 2022 · 4 comments
Labels
help wanted Extra attention is needed question Further information is requested
Milestone

Comments

@m-mohr
Copy link
Member

m-mohr commented Oct 12, 2022

This is one of the cases, where it seems the specification doesn't fully match what people expect. Also, implementations and examples did often also encourage the "wrong" way...
EPSG codes currently are provided as integers. We should probably also allow strings in 2.0 as this is what people seem to use quite a lot...

So the schema for it would change to something like:

{
  "title": "EPSG Code",
  "type": [
    "integer",
    "string"
  ],
  "subtype": "epsg-code",
  "oneOf": [
    {
      "type": "string",
      "pattern": "^(epsg|EPSG):\\d{4,}$"
    },
    {
      "type": "integer",
      "minimum": 1000
    }
  ],
  "examples": [
      3857,
      "EPSG:3857"
  ]
}

Thoughts?

@m-mohr m-mohr added help wanted Extra attention is needed question Further information is requested breaking labels Oct 12, 2022
@m-mohr m-mohr added this to the 2.0.0 milestone Oct 12, 2022
@soxofaan
Copy link
Member

In general I favor this, as the "EPSG:3857" notation seems to be very common in practical use. It's also more self-documenting than a raw integer 3857.

Counter argument: would users expect other prefixes are also allowed, e.g. something like "WGS:84"?

@LukeWeidenwalker
Copy link
Contributor

LukeWeidenwalker commented Nov 3, 2022

For reference, we're using https://pyproj4.github.io/pyproj/stable/api/crs/crs.html#pyproj.crs.CRS.from_user_input to validate CRS fields now, so we're happy with both strings and integers!

@m-mohr
Copy link
Member Author

m-mohr commented Nov 3, 2022

Thanks. I don't think so as it clearly states EPSG code in the schema, also validation should reject it. If you dig down into other authorities it quickly gets messy...

@m-mohr m-mohr removed the breaking label Mar 8, 2023
@m-mohr
Copy link
Member Author

m-mohr commented Mar 10, 2023

I've tried to do this, but the schemas get very messy. I'm think we should only cater for the string vs. number issue in the clients. It seems like allowing it in the process spec makes it a work item for clients + backends while otherwise it makes it only to a work item in the clients.

In the Web Editor for example it's not an issue at all as it hidden from the user anyway.
The R client also already converts from string to integer if I understand it correctly.
So it's just a work item for the Python client: Open-EO/openeo-python-client#259

@m-mohr m-mohr closed this as not planned Won't fix, can't repro, duplicate, stale Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants