-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block clockwise WKT polygons from searches and downloads #340
Comments
See also https://codepen.io/GBIFS/pen/mdgdrrJ |
I get this error message now from rgbif when trying to do clockwise downloads. Is this expected now? Error: Polygon with clockwise exterior ring: POLYGON ((8.64152 66.10075, 20.24262 63.18351, 24.24534 58.63805, 19.49635 52.6679, 10.74464 53.54985, 5.11369 60.53765, 8.64152 66.10075)). Did you mean these coordinates? (Note this is only part of the polygon or multipolygon you provided.) LINEARRING (8.64152 66.10075, 5.11369 60.53765, 10.74464 53.54985, 19.49635 52.6679, 24.24534 58.63805, 20.24262 63.18351, 8.64152 66.10075) |
Yes. A clockwise wkt polygon is a hole and not supported. Unless inside a enclosing polygon (counter clockwise winding) |
Clockwise rectangles are still accepted. |
We currently have different behaviour regarding WKT polygons between ElasticSearch (search and small downloads) and Hive (large downloads).
The WKT specification requires a normal polygon to be counterclockwise. A clockwise polygon represents a hole, i.e. the whole world except that polygon.
A few tools generate clockwise polygons. We've had problems with this before. It is presumably a rare requirement to have the whole world except some polygon, and if that is required it can be specified by
I suggest we reject queries where the outer polygon is clockwise as
400 Bad Request
, ideally with a suitable error message explaining the problem. (Could even give the reversed polygon...)Some earlier issues:
The text was updated successfully, but these errors were encountered: