[SERVER-9401] GeoJSON Parser: Can't extract geo keys from object, malformed geometry? Created: 19/Apr/13 Updated: 11/Jul/16 Resolved: 29/Apr/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | 2.4.2 |
| Fix Version/s: | 2.4.4, 2.5.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeffrey Mealo | Assignee: | hari.khalsa@10gen.com |
| Resolution: | Done | Votes: | 0 |
| Labels: | geo, geometry, geospatial, json | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu 12.04 LTS |
||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Steps To Reproduce: | 1. Insert geometry from input.json into a 2dsphere index |
||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
There seems to be a problem with the GeoJSON Parser. I've attached a JSON file containing valid GeoJSON (passes http://geojsonlint.com/). When I try to insert a document with input.json as the value for a 2dsphere index, I get the attached error (error.txt). |
| Comments |
| Comment by Neville Dipale [ 08/Oct/13 ] | |||||||||||||||||
|
Just saw this now. I had written a function in my project that parses LineStrings to remove adjacent points. Glad that I'll be able to remove that from 2.6 | |||||||||||||||||
| Comment by auto [ 13/May/13 ] | |||||||||||||||||
|
Author: {u'date': u'2013-04-25T17:10:00Z', u'name': u'Hari Khalsa', u'email': u'hkhalsa@10gen.com'}Message: | |||||||||||||||||
| Comment by auto [ 29/Apr/13 ] | |||||||||||||||||
|
Author: {u'date': u'2013-04-25T17:10:00Z', u'name': u'Hari Khalsa', u'email': u'hkhalsa@10gen.com'}Message: | |||||||||||||||||
| Comment by hari.khalsa@10gen.com [ 25/Apr/13 ] | |||||||||||||||||
|
Hi! Our internal geometry library expects that there are no adjacent identical vertices in lines. The LineString you provided had two adjacent identical points. We can detect and ignore these vertices. I will submit a fix shortly. | |||||||||||||||||
| Comment by Jeffrey Mealo [ 20/Apr/13 ] | |||||||||||||||||
|
This LineString is a way from OpenStreetMap. I can change the geometry when I go to insert it. I can see this being an issue with roundabouts and cul-de-sacs when storing road networks in MongoDB. If a line string forms a closed geometry, it should be represented as a polygon I suppose. I'm not sure if this is a bug, here's a relevant statement from the GeoJSON spec: "A LinearRing is closed LineString with 4 or more positions. The first and last positions are equivalent (they represent equivalent points). Though a LinearRing is not explicitly represented as a GeoJSON geometry type, it is referred to in the Polygon geometry type definition." http://www.geojson.org/geojson-spec.html#id16 It doesn't explicitly say one way or another; if anything, it states that the specification is incomplete. Any thoughts? | |||||||||||||||||
| Comment by Daniel Pasette (Inactive) [ 19/Apr/13 ] | |||||||||||||||||
|
Parser is having trouble parsing repeated positions in a sequence. I don't think the spec says this is illegal. Repeated positions but not in sequence parses fine.
|