2

I got some data from Zillow's neighborhood database as shapefiles and converted them to GeoJSON. However, some of the objects appear to be malformed when inserting them into MongoDb. Is there anything obvious incorrect with this object? If not, I'll post to a mongodb group.

I get the mongodb error Exterior shell of polygon is invalid

Here is the GeoJSON that validates on http://geojsonlint.com

{ "type": "Polygon", "coordinates": [ [ [ -118.446969222686, 34.0469016326594 ], [ -118.434190835956, 34.0504320311002 ], [ -118.430613269546, 34.0514987186012 ], [ -118.423933835946, 34.0574851170443 ], [ -118.423199406258, 34.0549809139169 ], [ -118.422660125007, 34.0533079256341 ], [ -118.421636562507, 34.0524724295396 ], [ -118.421512675788, 34.0512202381322 ], [ -118.41717327344, 34.046211074065 ], [ -118.416411648439, 34.0466005350029 ], [ -118.412196886716, 34.0489869060989 ], [ -118.409930683589, 34.0502700193813 ], [ -118.406049503898, 34.0526248670397 ], [ -118.405972386711, 34.0526120701647 ], [ -118.405962628898, 34.0526126092272 ], [ -118.405960624992, 34.0526101170397 ], [ -118.405959847648, 34.0526091482897 ], [ -118.405959847648, 34.0526099881335 ], [ -118.405960624992, 34.0526101170397 ], [ -118.405962624992, 34.0526126092272 ], [ -118.405668488273, 34.0526288904772 ], [ -118.405687144523, 34.0526748201648 ], [ -118.406090394523, 34.0535528201656 ], [ -118.405981945304, 34.0540129959473 ], [ -118.405474109366, 34.0542725857913 ], [ -118.40546691796, 34.0549122811044 ], [ -118.405903062492, 34.0549061678231 ], [ -118.405825968742, 34.0556394139175 ], [ -118.405820851554, 34.0571164373564 ], [ -118.399104050767, 34.0571106834502 ], [ -118.39054288279, 34.0571204920439 ], [ -118.38356623044, 34.0570572772001 ], [ -118.383860707003, 34.0544064764164 ], [ -118.384332789034, 34.0504714412565 ], [ -118.385436363254, 34.0487181834424 ], [ -118.389399999977, 34.0347272732731 ], [ -118.391367691385, 34.0301953865501 ], [ -118.391625523416, 34.0300484412375 ], [ -118.392837789042, 34.0295663865495 ], [ -118.393894082012, 34.0291868552992 ], [ -118.397096902327, 34.0289949412365 ], [ -118.399457230455, 34.029248132643 ], [ -118.404499855459, 34.0296909529559 ], [ -118.407776429681, 34.030082620925 ], [ -118.411082187497, 34.0307397263944 ], [ -118.415095054688, 34.031983468583 ], [ -118.418410257816, 34.0320081951455 ], [ -118.422025265632, 34.0318939295204 ], [ -118.426063460948, 34.0318955701454 ], [ -118.429185390639, 34.0317586248328 ], [ -118.432878500017, 34.0313464529574 ], [ -118.433469000018, 34.0314239021762 ], [ -118.436109089864, 34.0337636365534 ], [ -118.43832727346, 34.0371181795253 ], [ -118.446969222686, 34.0469016326594 ] ] ] }
  • I hope you let us know if you find the answer. – user23321 Jan 13 '14 at 18:57
1

MongoDB does not accept duplicate entries. So I guess you'll have to check and remove if there are any. I was getting the same error and removing the duplicate entries solved it for me.

  • I think you may have been better to have posted this more clearly as an Answer because I hastily flagged it as "Not an Answer" based on your opening sentence. However, in retrospect I should probably have just edited it. – PolyGeo Mar 27 '14 at 9:03
  • So in this example, the polygon coordinates for the start and end point are duplicated [-118.446969222686, 34.0469016326594] – nmtoken Apr 28 '14 at 17:10
  • with the latest release of MongoDB(2.6), all these problems have been resolved – Anvith May 1 '14 at 5:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.