-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.0.5
-
Component/s: Geo
-
None
-
ALL
-
-
RPL A (10/09/15), Repl B (10/30/15)
I am trying to import data on German administrative regions (from www.bkg.bund.de) into a mongoDB. The data contains borders as GeoJSON conforming MultiPolygons (confirmed by geojsonlint.com). Howerver, when trying to create a 2dsphere index on data containing MultiPolygons with duplicate vertices or self intersections (e. g. the state of Bavaria), mongoDB will through an error.
In the issues SERVER-16238 and SERVER-13735 there are several mentions of duplicate vertices or self intersections within MultiPolygons being invalid according to the GeoJSON spec. Therefore, these bug reports have been resolved as "Works as Designed". However, I do not find these restrictions in the GeoJSON spec. I also don't find mentions of restrictions of the 2dsphere index that go beyond the GeoJSON spec in the mongoDB docs.
Are these restrictions necessary or could they be removed in future versions? A lot of valid geospatial data out there will not be usable in mongoDB with these restrictions, and many people seem to have noticed. See, also:
http://gis.stackexchange.com/questions/135871/sqlserver-shapefile-export-wont-load-in-mongodb-due-to-self-intersection
http://stackoverflow.com/questions/24398292/mongodb-version-2-6-still-fails-on-2dsphere-geoindexing-citing-inability-to-extr?rq=1
http://stackoverflow.com/questions/23290114/mongodb-malformed-geometry-when-creating-a-geosphere-index?noredirect=1#comment35654181_23290114