[SERVER-9724] Duplicate coordinate in GeoJSON LineString cause "malformed geometry" (2dsphere index) Created: 17/May/13 Updated: 10/Dec/14 Resolved: 17/May/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | 2.4.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Mauro Carabotti | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
mongo shell on Ubuntu 12.10 64bit |
||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | Create a 'trails' collection with a 2dsphere index on "path" mine is like that (stats output): { , Try to save an item with the following in mongodb shell (duplicate coordinates in bold): db.trails.insert({"name": "ch1086.121", "path": {"type": "LineString", "coordinates": [[7.416898, 47.339062], [7.416977, 47.339134],[7.416977, 47.339134]]}}) You get: Can't extract geo keys from object, malformed geometry?: { type: "LineString", coordinates: [ [ 7.416898, 47.339062 ], [ 7.416977, 47.339134 ], [ 7.416977, 47.339134 ] ] }Wenn removing duplicates it works: db.trails.insert({"name": "ch1086.121", "path": {"type": "LineString", "coordinates": [[7.416898, 47.339062], [7.416977, 47.339134]]}}) |
||||||||
| Participants: | |||||||||
| Description |
|
When trying to insert a LineString GeoJSON containing duplicate coordinates pair you get. Can't extract geo keys from object, malformed geometry I would expect this to work. Duplicates coordinates can occur quite often for example when you are parsing gpx files and saving them (I noticed it that way). |