openeo-python-client icon indicating copy to clipboard operation
openeo-python-client copied to clipboard

Smarter geometry loading from `DataCube.aggregate_spatial`

Open soxofaan opened this issue 1 year ago • 1 comments

DataCube.aggregate_spatial(geometries) currently allows geometries to be a string or pathlib.Path, but then it assumes this is a backend-side path and "loads" this with non-standard read_vector.

It would be better (more user friendly, and more standard) to be a bit smarter here:

  • check if the string is a GeoJSON dump and load it like that
  • check if the string/path is a valid local (GeoJSON) file and load geometry from that

Also

  • start deprecating the current read_vector code path
  • share this feature with other geometry related processes
  • document this feature better

soxofaan avatar Jun 25 '24 07:06 soxofaan

(this was triggered from https://discuss.eodc.eu/t/aggregate-spatial/766)

soxofaan avatar Jun 25 '24 07:06 soxofaan

This looks like low hanging fruit that can solve some issues. The client can also be smart about injecting a 'load_geojson' process, if that is supported by the backend. That way, users automatically get the 'preferred' behaviour and avoid deprecation warnings from the backend.

jdries avatar Nov 22 '24 11:11 jdries

Changes are made with issue #104

ElienVandermaesenVITO avatar Jan 02 '25 13:01 ElienVandermaesenVITO