Skip to content

Support VectorCube type as spatial_extent in load_collection #385

Open

Description

@VincentVerelst

I get an error when providing vector data as spatial_extent in load_collection:

{'loadurl1': {'process_id': 'load_url',
  'arguments': {'format': 'Parquet',
   'url': 'https://artifactory.vgt.vito.be/artifactory/auxdata-public/gfmap/32736-random-points.geoparquet'}},
 'loadcollection1': {'process_id': 'load_collection',
  'arguments': {'bands': ['NDVI_10M'],
   'id': 'TERRASCOPE_S2_NDVI_V2',
   'spatial_extent': {'from_node': 'loadurl1'},
   'temporal_extent': ['2022-05-01', '2022-05-30']},
  'result': True}}

This process graph results in OpenEoApiError: [500] Internal: Server error: AttributeError("'DriverVectorCube' object has no attribute 'get'")

It's not a blocking issue for me, as there is an easy workaround, by just omitting the spatial_extent in load_collection. However, could we already provide a clearer error message in the meantime?

CC: @Pratichhya

Activity

  1. EmileSonneveld commented on Mar 20, 2025

    @EmileSonneveld
    Member

    @VincentVerelst , do you have a job-id or request ID?
    Otherwise the probably stack trace is:

      File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 747, in load_collection
        arguments["spatial_extent"] = _extract_bbox_extent(
      File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1464, in _extract_bbox_extent
        if handle_geojson and extent.get("type") in [
    AttributeError: 'DriverVectorCube' object has no attribute 'get'
    
  2. VincentVerelst commented on Mar 20, 2025

    @VincentVerelst
    Author

    @EmileSonneveld, j-25032012233243e4b07404b15f1a26a8 on Terrascope

  3. bossie commented on Jul 10, 2026

    @bossie
    Collaborator

    This popped up again: Teams

    aoi = eoconn.load_url("https://raw.githubusercontent.com/Pratichhya/Pratichhya.github.io/refs/heads/master/content/fewparcels.geojson", format="GeoJSON")
    # aoi_pq = eoconn.load_url("https://artifactory.vgt.vito.be/artifactory/auxdata-public/marketplace/services_dependency/wig_file.parquet", format="Parquet")
    cube = eoconn.load_collection(
        "TERRASCOPE_S2_NDVI_V2",
        spatial_extent=aoi,
        temporal_extent=["2022-05-01", "2022-05-30"],
        bands=["NDVI_10M"],
    )
    # Rescale digital number to physical values and take temporal maximum.
    cube = cube.apply(lambda x: 0.004 * x - 0.08).max_time()
    
    cube.execute_batch(title="ndvi timeseries using url")
    

    Error:

    Preflight process graph validation raised: [ProcessParameterInvalid] The value passed for parameter 'spatial_extent' in process 'load_collection' is invalid: Expected dictionary/mapping but got vector cube.
    

    The workaround is to replace the spatial_extent argument to load_collection with add a call to filter_spatial(aoi).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions