[SERVER-16238] Can't extract geo keys from object, malformed geometry? Created: 19/Nov/14  Updated: 19/Nov/14  Resolved: 19/Nov/14

Status: Closed
Project: Core Server
Component/s: Geo
Affects Version/s: 2.6.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Tom Assignee: Ramon Fernandez Marina
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File mp.json    
Operating System: ALL
Participants:

 Description   

insertDocument :: caused by :: 16755 Can't extract geo keys from object, malformed geometry?: { _id: ObjectId('546cdf43d4ac140dfe5a2077'), type: "Feature", properties:

{ name: "M6" }

, geometry: { type: "MultiPolygon", coordinates: [ [ [ [ -2.309013473108151, 53.48918375753105 ], [ -2.308857419510197, 53.48932362256203 ], [ -2.308146400619123, 53.48996058108416 ], [ -2.307723364124215, 53.49079646139326 ], [ -2.307647118187288, 53.49080393578156 ], [ -2.307155615486123, 53.49083584343507 ], [ -2.306

I've used http://geojsonlint.com/ to validate the geojson and used http://mapshaper.org/ to check for intersections (it says there are none).

Is this a bug or is there something wrong with my JSON?



 Comments   
Comment by Ramon Fernandez Marina [ 19/Nov/14 ]

tdegrunt, looks like vertices 0 and 1603 are duplicated. I was able to quickly find out by using a 2.7.8 version of MongoDB, as SERVER-14508 introduced a descriptive error message for invalid JSON:

> db.foo.ensureIndex({geometry:"2dsphere"})
{
        "createdCollectionAutomatically" : false,
        "numIndexesBefore" : 1,
        "errmsg" : "exception: Can't extract geo keys: { _id: ObjectId('546ce1466638602df257a845'), type: \"Feature\", properties: { name: \"M6\" }, geometry:
        ... Duplicate vertices: 0 and 1603",
        "code" : 16755,
        "ok" : 0
}

Generated at Thu Feb 08 03:40:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.