Open-EO / openeo-processes

Interoperable processes for openEO's big Earth observation cloud processing.
https://processes.openeo.org
Apache License 2.0
48 stars 15 forks source link

`filter_spatial`: Clarify masking #470

Closed m-mohr closed 11 months ago

m-mohr commented 11 months ago

Fixes #469

m-mohr commented 11 months ago

One related question that came up: How is filter_bbox handled if the CRS of the bbox is different from the data cube CRS? Do you reproject the bbox to the data cube CRS first to align? Otherwise, you may also get an outside area that you may need to null. I think we should clarify that, too. What do the implementation do? @clausmichele @soxofaan @dthiex

soxofaan commented 11 months ago

How is filter_bbox handled if the CRS of the bbox is different from the data cube CRS? Do you reproject the bbox to the data cube CRS first to align? Otherwise, you may also get an outside area that you may need to null.

Yes we reproject (e.g. typically from lon-lat to UTM) and I should double check the implementation details, but I think the intent is to use the tightest bbox in target CRS (e.g. UTM) that covers the specified bbox (e.g. in lon-lat). So indeed, you might get more pixels outside of the original bbox, but I don't think that is a problem in most use cases. And if it is a problem you should use explicit masking (e.g. with mask_polygon or filter_spatial) anyway.

clausmichele commented 11 months ago

We also reproject the bbox first to match the data projection, here is the implementation: https://github.com/Open-EO/openeo-processes-dask/blob/597d1005a91bb36823d191cb14507f5a1ee716f1/openeo_processes_dask/process_implementations/cubes/_filter.py#L105

m-mohr commented 11 months ago

Thanks, I've added a clarifying remark to filter_bbox in this PR.