Open-EO / openeo-geotrellis-extensions

Java/Scala extensions for Geotrellis, for use with OpenEO GeoPySpark backend.
Apache License 2.0
5 stars 3 forks source link

load_stac: netcdf timeseries - extent inaccurate #284

Open jdries opened 2 months ago

jdries commented 2 months ago

load_stac without specifying extent results in wrong extent, jobs:

Try to load in a STAC collection where the netCDF is in one of the items (j-2404172488c14135a8cd22c8c7aefa72) Try to load in a STAC item that is directly downloaded from openeo batch job results (j-2404179510cd40939a9959d6ff46c3ac)

Example logging:

Writing netCDF to /data/projects/OpenEO/j-2404172488c14135a8cd22c8c7aefa72/openEO.nc with bands [S2-L2A-B01, S2-L2A-B02, S2-L2A-B03, S2-L2A-B04, S2-L2A-B05, S2-L2A-B06, S2-L2A-B07, S2-L2A-B08, S2-L2A-B8A, S2-L2A-B09, S2-L2A-B11, S2-L2A-B12, S2-L2A-SCL, S2-L2A-DISTANCE_TO_CLOUD], uint16ud32769, EPSG:32631, GridExtent(Extent(501819.77327986486, 5671290.266626977, 502469.77327986486, 5671940.266626977), CellSize(10.0,10.0), 65x65)

Problematic line of code: https://github.com/Open-EO/openeo-geotrellis-extensions/blob/221b1c9c2bde0c24ecd3c583b0fdff91f3e54670/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/layers/NetCDFCollection.scala#L104

Solution: try using bounding boxes in raster crs, or if not available, do reprojection of polygon and then compute bbox in utm