rtdeb / GeoPick

Simple uncertainty radius calc for lines and polygons
2 stars 0 forks source link

Ensure WKT polygons are closed and have the correct order #116

Open MattBlissett opened 2 months ago

MattBlissett commented 2 months ago

Creating a polygon by clicking points in a clockwise order produces WKT with the points in a clockwise order. This is a "hole" according to the OGC standard.

aescobarr commented 2 months ago

Thanks @MattBlissett that's alarming and I was completely unaware it might happen. We probably should:

a) Clarify whether we allow holes in the digitised geometries (I am not sure about this right now, @arnaldmarcer ?) b) If we don't allow holes, check the order of the vertexes and invert them if necessary before performing any centroid calculation

MattBlissett commented 2 months ago

The case here is a user using GeoPick to generate a polygon for subsequent use in a GBIF download.

We've found inconsistencies between different tools when handling polygons with clockwise ordering, so last year (I think) tightened the verification on the GBIF API to block them.