Open-EO / openeo-geopyspark-driver

OpenEO driver for GeoPySpark (Geotrellis)
Apache License 2.0
26 stars 4 forks source link

Using load_stac with a path to STAC catalog JSON file #587

Closed EmileSonneveld closed 10 months ago

EmileSonneveld commented 10 months ago

load_stac using a file path works sync, but crashes when running as batch job:

openeo.rest.OpenEoApiError: [500] Internal: Server error: MissingSchema("Invalid URL '/data/MTDA/MODIS/GLASS_FAPAR/tiff_collection_months_mean/collection.json': No scheme supplied. Perhaps you meant https:///data/MTDA/MODIS/GLASS_FAPAR/tiff_collection_months_mean/collection.json?") (ref: r-231117a052f74a9589ddbff8a4cdf5ce)

With file:// prefix: openeo.rest.OpenEoApiError: [500] Internal: Server error: InvalidSchema("No connection adapters were found for 'file:///data/MTDA/MODIS/GLASS_FAPAR/tiff_collection_months_mean/collection.json'") (ref: r-2311170302e349f9b898adbf95cfe1e2)

@JohanKJSchreurs notes: there is a library that could help us to support file:// https://github.com/dashea/requests-file

bossie commented 10 months ago

Available on dev.

Tested with this batch job:

{
  "process_graph": {
    "load1": {
      "process_id": "load_stac",
      "arguments": {
        "url": "/data/MTDA/MODIS/GLASS_FAPAR/tiff_collection_months_mean/collection.json",
        "spatial_extent": {
          "coordinates": [
            [
              [
                19.42016156599624,
                -33.62480434411129
              ],
              [
                19.42016156599624,
                -33.654774806681765
              ],
              [
                19.46223622012357,
                -33.654774806681765
              ],
              [
                19.46223622012357,
                -33.62480434411129
              ],
              [
                19.42016156599624,
                -33.62480434411129
              ]
            ]
          ],
          "type": "Polygon"
        },
        "temporal_extent": [
          "2000-08-01T00:00:00Z",
          "2001-01-01T00:00:00Z"
        ]
      }
    },
    "save1": {
      "process_id": "save_result",
      "arguments": {
        "data": {
          "from_node": "load1"
        },
        "format": "GTIFF"
      },
      "result": true
    }
  },
  "parameters": []
}