onestop
onestop copied to clipboard
Generating invalid multipolygon
Found a record failing to index because the multipolygon we make isn't valid: http://localhost/registry/metadata/collection/unknown/3ef068c5-f359-43ae-b304-6eddf35dee3e/parsed
error message from geojsonlint.com is Line 1: Polygons and MultiPolygons should follow the right-hand rule
We need to be VERY careful fixing this, so we don't break other multipolygons!
two potential sources of bug:
- incorrectly identified as crossing antimeridian when it doesn’t - shouldn’t be a multipolygon at all
- does cross antimeridian, should be a multipolygon, but somehow order of points is wrong
this example should be fixed:
- [ ] generates a valid multipolygon or polygon
- [ ] generates the correct covering polygon(s) for this record (see potential sources of bug)
- [ ] the test cases are complete enough to make sure we don’t break other multipolygons that are correct and working, and this case is added to that set
A reminder - we create multipolygons when bbox crosses the antimeridian in compliance with this recommendation: https://tools.ietf.org/html/rfc7946#section-3.1.9 This is because some (large) bboxes are indexed by ES incorrectly otherwise, and other solutions may cause issues with other tech that handles antimeridian or points outside the -180 to -180 range differently.
Java Topology Suite probably has code to handle/check this
Need to find a better example of this situation... the record indicated here could be fixed by a metadata manager, but if this is a real bug we need to find a clear example.