Open-EO / openeo-processes

Interoperable processes for openEO's big Earth observation cloud processing.
https://processes.openeo.org
Apache License 2.0
48 stars 15 forks source link

vector_buffer: result of shrinking until there is nothing left? #404

Closed bossie closed 1 year ago

bossie commented 1 year ago

Process ID: vector_buffer

Describe the issue: We've run into this edge case where applying a negative buffer to a small polygon resulted in an empty (shapely) polygon. It's not clear what the result of this process should be.

Additional context: https://github.com/Open-EO/openeo-geopyspark-driver/issues/314

m-mohr commented 1 year ago

Good point. What do you think should happen? Throw an error? Empty geometry?

jdries commented 1 year ago

We were a bit unsure:

We now throw an error, but would be better if we can also make it somehow work for this case.

m-mohr commented 1 year ago

Yes, I'd need input from the different back-ends so that we standardize what the tooling actually does or what makes most sense, i.e. find hopefully a common denominator. Otherwise, throwing an error is always the last resort.

m-mohr commented 1 year ago

Details for VITO: https://github.com/Open-EO/openeo-python-driver/issues/164

m-mohr commented 1 year ago

Why is it an issue in downstream processes to have empty geometries/coordinates? @jdries In the discussion it sounds like the preferrable option would be to handle empty geometries. We were not sure what the downstream issues are.

GeoJSON supports empty geometries/coordinates.

jdries commented 1 year ago

Handling empty geometries everywhere is indeed an option, perhaps also the best one as it would result in least errors for the users. The main issue with it is that a lot of existing (open source) implementations do not support empty geometries, and thus errors are thrown, often badly readable. Hence, openEO backend implementors will have to add explicit support in all vector processes.

m-mohr commented 1 year ago

@jdries Thanks. Which implementations are this? In the call it seemed people were at least not so concerned about the Python ecosystem. Spark?

jdries commented 1 year ago

For us, it's a mixture of Python and Scala (geotrellis), but I don't think it can be linked to an ecosystem. In general, it's safe to assume that there will for sure exist implementations that do not deal well with it, and it needs to be tested case by case. So in any case, we can perhaps move forward with documenting handling of empty geometries in vector cubes?

m-mohr commented 1 year ago

Do you mean on a case-by-case basis per process? Or generally in openEO? For the latter I'm not sure what we could document apart from that maybe empty geometries should be supported and if not, they get removed or so?

On a per-process basis:

Sounds good?

edit: add a general comment about empty geometries to the data cube introduction/glossary.