These are chat archives for download13/thirdspace-chat

14th
Mar 2015
Erin Dachtler
@download13
Mar 14 2015 16:08
So I got the ways into the database with all their geojson data embedded in each document. The only problem is that some of the node sequences are out of order. They're supposed to be a clockwise or ccw ring of points that form an enclosed polygon but some have lines that intersect instead.
{"type": "Polygon", "coordinates": [ [ [ -79.88709369999999, -2.2014595 ], [ -79.8868007, -2.2015314 ], [ -79.88718, -2.2018709 ], [ -79.88688879999999, -2.2019374 ], [ -79.88709369999999, -2.2014595 ] ] ] }
Try putting that data into this validator and you'll see what I mean
I found a library that can do validation of GeoJSON data and see if there's something wrong like this, but I'm not sure how to actually fix it when it says there's something wrong.
If there's only a few problematic areas I guess we could just drop those records from the database and call it good enough, but if this is a common thing in the OSM data we need a way to order a list of coordinates so they form an enclosed shape.
Any ideas?