Open soxofaan opened 5 days ago
related discussions and threads:
As far as I understand the threads above, the "crs" support mentioned above was originally targeted to the use case where the geometry is provided as shapely object (which has no explicit CRS info), which has to be converted to GeoJSON to be embedded in the process graph. Over time, a lot more geometry value types for geometries
were added (e.g UDP parameters, vector cubes, load_url, ...), where it's impossible to attach that CRS to, so we now have a very inconsistent CRS handling situation.
proposed solution:
crs
/srs
arguments directly in aggregate_spatial
, ... (because it's impossible to do it consistently). Instead throw exception pointing to proper way to do it (e.g. docs).So use cases that wanted to use shapely geometries with custom crs the old way:
cube = cube.aggregate_spatial(
geometries=shapely_geometry,
crs="EPSG:123456",
...
)
would have to change to something like
cube = cube.aggregate_spatial(
geometries=shapely_to_geojson(shapely_geometry, crs="EPSG:123456"),
...
)
I would:
stumbled on this while working on #104: https://github.com/Open-EO/openeo-python-client/blob/5a3e6f40cf5945ea885165db9845587435be66f0/openeo/rest/datacube.py#L1074-L1087
e.g. public facing from
cube.aggregate_spatial(..., crs=...)
andcube.mask_polygon(..., srs=...)
This CRS handling has some problems:
I think we should get rid of this