[SERVER-11988] Cant create 2dsphere index on array of GeoJSON LineString: ""Can't extract geo keys from object, malformed geometry?" Created: 06/Dec/13 Updated: 10/Dec/14 Resolved: 26/Jun/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | 2.5.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Fabian Köster | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | indexing | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Gentoo Linux amd64 |
||
| Operating System: | Linux |
| Steps To Reproduce: | 1.) insert document mentioned previously |
| Participants: |
| Description |
|
I have a database containing way segments from OpenStreetMap stored as an array of GeoJSON LineString objects:
Trying to create a 2dsphere index throws the following error:
I checked the format with http://geojsonlint.com/ but everything seems to be correct. Am I missing something or is indexing such an array not supported yet? |
| Comments |
| Comment by Fabian Köster [ 27/Jun/14 ] |
|
Hi Thomas, thanks for the hint, I will try that! Regards, |
| Comment by Thomas Rueckstiess [ 26/Jun/14 ] |
|
Hi Fabian, I believe the correct GeoJSON Format that you're looking for is a MultiLineString, which we started supporting with MongoDB version 2.6. Regards, |
| Comment by Fabian Köster [ 23/Dec/13 ] |
|
OK, I found a workaround for my application: Instead of using way segments (of two points each) I now create GeoJSON LineStrings over the whole path: > db.ways.findOne() , I can now create a 2dsphere index over the 'loc' attribute as expected: > db.ways.ensureIndex( {"loc": "2dsphere"}); So the problem seems to be that 2dsphere index does not work over lists of LineStrings. |