Open-EO / openeo-geopyspark-driver

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

sample_by_feature: use feature property to name output items/assets #722

Closed jdries closed 3 months ago

jdries commented 3 months ago

@VincentVerelst on cdse staging, can you try setting feature_id_property in your format options? It needs to be set to a property of your vector data, like 'id' or something else that's unique.

VincentVerelst commented 3 months ago

It seems that the item ID's are still just the default ones (openEO_0.nc, openEO_1.nc, etc.). I've labelled the ID's in my geometry explicitly as test_id_0, test_id_1, etc. and used the following code:

sampled_features = s2.filter_spatial(geometry)
job = sampled_features.execute_batch(
    title="Test feature property to name output files in sample_by_feature",
    out_format="netCDF",
    sample_by_feature=True,
    feature_id_property='id')

Batch job ID: j-240314c4cc37439caad5ce544eef3f89 Run on CDSE-staging

jdries commented 3 months ago

@VincentVerelst I had a look, I think it currently only works when you have a 'real' vector cube in filter spatial, rather than specifying geojson inline. We should also fix this, but it could be that it actually works already when gfmap loads the geometry from geoparquet.

jdries commented 3 months ago

Also made a commit to try and make it work for inline FeatureCollection, still needs to go through pipelines.

JeroenVerstraelen commented 3 months ago

Vincent confirmed that this works. (Geoparquet and geojson).