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

Dates before 1970 not supported #223

Open EmileSonneveld opened 9 months ago

EmileSonneveld commented 9 months ago

When requesting ERA5 before 1970, there is an error thrown. This is not a blocker for me, as I only need data from 1980.

Code used to reproduce this:

connection.load_disk_collection(
    format="GTiff",
    # Based on https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-land-monthly-means
    glob_pattern="/data/users/Public/emile.sonneveld/ERA5-Land-monthly-averaged-data/tiff_collection/*/*/*/*_total_precipitation.tiff",
    options=dict(date_regex=r".*tiff_collection/(\d{4})/(\d{2})/(\d{2})/.*"),
).filter_temporal("1950-01-01", "1960-01-01")

Error log:

py4j.protocol.Py4JJavaError: An error occurred while calling o1648.datacube_seq.
: java.lang.IllegalArgumentException: requirement failed: Range bounds must be ordered, but 5270497993233154340 > 17627158169888
    at org.locationtech.sfcurve.zorder.ZRange.<init>(ZRange.scala:20)
    at org.locationtech.sfcurve.zorder.ZRange$.apply(ZRange.scala:38)
    at org.openeo.geotrelliscommon.zcurve.SfCurveZSpaceTimeKeyIndex.indexRanges(SfCurveZSpaceTimeKeyIndex.scala:57)
    at org.openeo.geotrelliscommon.zcurve.SfCurveZSpaceTimeKeyIndex.indexRanges(SfCurveZSpaceTimeKeyIndex.scala:54)
    at org.openeo.geotrelliscommon.package$ConfigurableSpaceTimePartitioner.indexRanges(package.scala:143)
    at geotrellis.spark.partition.SpacePartitioner.<init>(SpacePartitioner.scala:34)
    at org.openeo.geotrelliscommon.DatacubeSupport$.createPartitioner(DatacubeSupport.scala:186)
    at org.openeo.geotrellis.layers.FileLayerProvider$.createPartitioner(FileLayerProvider.scala:414)
    at org.openeo.geotrellis.layers.FileLayerProvider$.tileSourcesToDataCube(FileLayerProvider.scala:349)
    at org.openeo.geotrellis.layers.FileLayerProvider$.readMultibandTileLayer(FileLayerProvider.scala:288)
    at org.openeo.geotrellis.geotiff.PyramidFactory.rasterSourceRDD(PyramidFactory.scala:228)
    at org.openeo.geotrellis.geotiff.PyramidFactory.layer(PyramidFactory.scala:185)
    at org.openeo.geotrellis.geotiff.PyramidFactory.datacube_seq(PyramidFactory.scala:246)