Open-EO / openeo-python-client

Python client API for OpenEO
https://open-eo.github.io/openeo-python-client/
Apache License 2.0
156 stars 42 forks source link

Better documentation and validation/normalization of CRS code usage #437

Closed soxofaan closed 1 year ago

soxofaan commented 1 year ago

A Terrascope user got a cryptic error message

...
py4j.protocol.Py4JJavaError: An error occurred while calling z:org.openeo.geotrellis.ProjectedPolygons.fromExtent.
: org.locationtech.proj4j.UnknownAuthorityCodeException: 32616
    at org.locationtech.proj4j.CRSFactory.createFromName(CRSFactory.java:85)
...

after some digging it turned out that the CRS was wrongly encoded in process graph, something like:

      "process_id": "load_collection",
        ...
        "spatial_extent": {
          "west": 300000,
          ...
          "north": 2100000,
          "crs": "32616"
        },

In Terrascope backend we support "crs": 32616 and "crs": "EPSG:32616", but not "crs": "32616". Apparently we document these subtleties not very good in the openeo python client docs.

It would also be better if we already catch this error client side (so bit of validation/normalization of crs in various places)

jdries commented 1 year ago

extra idea: support pyproj.CRS as input

JohanKJSchreurs commented 1 year ago

This PR below will also help to alleviate this problem:

Nonetheless, we do need to document more clearly how to use the CRS / EPSG codes.

soxofaan commented 1 year ago

can be closed now