Tuesday 26 December 2017

enterprise geodatabase - SQLServer Shapefile Export won't load in MongoDB due to self intersection


I am having an issue loading a handful of GeoJSON files that were created from a shapefile export from SQLServer into MongoDB. This polygon will not load in MongoDB because of two duplicate vertices in the perimeter of the polygon. I noticed in our original data (before it was ever imported into SQLServer) the data had two rings; part 0 and part 1. Once the data is in SQLServer, it only has part 0, which is why I think MongoDB can't use this polygon. We are using ogr2ogr to convert the shapefiles to GeoJSON. Anyone happen to have a solution to this issue?



MongoDB Documentation: Polygons with Multiple Rings


For Polygons with multiple rings:


The first described ring must be the exterior ring.
The exterior ring cannot self-intersect.
Any interior ring must be entirely contained by the outer ring.
Interior rings cannot intersect or overlap each other. Interior rings cannot share an edge

View of stacked vertices in SDE


View of one vertex in part 0 from original shapefile before imported into SQLServer


View of one vertex in part 0 from original shapefile before imported into SQLServer



The first image shows the two stacked vertices exported from SQLServer. The next two images show the vertex in part 0 and the second vertex in part 1 of the original shapefile (before it went into SQLServer)




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...