Open-EO / openeo-processes-dask

Python implementations of many OpenEO processes, dask-friendly by default.
Apache License 2.0
19 stars 14 forks source link

aggregate_spatial needs to translate incoming geometries to same CRS as the data #237

Closed danielFlemstrom closed 4 months ago

danielFlemstrom commented 6 months ago

data.xvec.zonal_stats assumes that geometries and data has same CRS.

As a consequence we need to update aggregate.py::aggregate_spatial with

  ... 
    gdf = gdf.to_crs(data.rio.crs)            <------ This one needs to be added
    geometries = gdf.geometry.values

    positional_parameters = {"data": 0}
    vec_cube = data.xvec.zonal_stats(
...

Example when we get all null out of aggregate spatial

IN: data with SWEREF geometries in WGS84 reducer median OUT: polygon misses the data and we get all null