Open-EO / Open-EO/openeo-python-driver
Issue when using different CRS in load_collection and aggregate_spatial
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12
- Forks
- 8
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 4
Description
Issue reported by colleague Landuyt, using a geometry initially defined in UTM, but ending up in different CRSes in process graph.
e.g. EPSG:32631 in load_collection spatial extent and implicit EPSG:4326 in aggregate_spatial geometry:
{
"process_graph": {
"loadcollection1": {
"process_id": "load_collection",
"arguments": {
"bands": ["B02"],
"id": "TERRASCOPE_S2_TOC_V2",
"spatial_extent": {"west": 476580, "south": 5641538, "east": 492312, "north": 5650941, "crs": "EPSG:32631"},
"temporal_extent": ["2022-09-01", "2022-09-15"]
}
},
"aggregatespatial1": {
"process_id": "aggregate_spatial",
"arguments": {
"data": {"from_node": "loadcollection1"},
"geometries": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[2.8906121198012946, 50.9254284428713],
[2.890413345052933, 51.00998523843394],
[2.6661682282259633, 51.0095597508646],
[2.6667737398200884, 50.925004228736995],
[2.8906121198012946, 50.9254284428713]
]
]
}
}
]
},
"reducer": {
"process_graph": {
"mean1": {"process_id": "mean", "arguments": {"data": {"from_parameter": "data"}}, "result": true}
}
}
},
"result": true
}
}
}
Fails currently with
OpenEoApiError: [500] Internal: Server error: RuntimeError("Unexpected crs: '+proj=utm +zone=31 +datum=wgs84 +units=m +no_defs +type=crs' != '+proj=longlat +datum=wgs84 +no_defs +type=crs'") (ref: r-d61de60afce04da99952ec268167beec)
bottom part of related stack trace:
File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 1484, in apply_process
return process_function(args=ProcessArgs(args, process_id=process_id), env=env)
File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/ProcessGraphDeserializer.py", line 552, in load_collection
return env.backend_implementation.catalog.load_collection(collection_id, load_params=load_params, env=env)
File "/opt/venv/lib64/python3.8/site-packages/openeo/util.py", line 386, in wrapper
return f(*args, **kwargs)
File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/layercatalog.py", line 123, in load_collection
return self._load_collection_cached(collection_id, load_params, WhiteListEvalEnv(env,WHITELIST))
File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/layercatalog.py", line 230, in _load_collection_cached
projected_polygons = to_projected_polygons(
File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/utils.py", line 203, in to_projected_polygons
raise RuntimeError(f"Unexpected crs: {provided_crs!r} != {expected_crs!r}")
RuntimeError: Unexpected crs: '+proj=utm +zone=31 +datum=wgs84 +units=m +no_defs +type=crs' != '+proj=longlat +datum=wgs84 +no_defs +type=crs'
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the supplied process graph, then start in openeogeotrellis/utils.py at to_projected_polygons and trace the call from openeogeotrellis/layercatalog.py in load_collection. Use the reported CRS mismatch and stack trace to understand the failure path; done means the example no longer fails because load_collection and aggregate_spatial use different CRSes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100