[SERVER-21607] 2dsphere index does not accept valid GEOJSON with 3 coordinates Created: 20/Nov/15  Updated: 21/Nov/15  Resolved: 21/Nov/15

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

Type: Bug Priority: Major - P3
Reporter: This Wiederkehr Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-9220 allow more than two values in the coo... Closed
Operating System: ALL
Steps To Reproduce:
  • create 2dsphere index on loc
  • try: db.locations.insert({"loc": {"type": "Point", "coordinates" : [ 1,2,3 ]}})
  • which fails with: Can't extract geo keys from object, malformed geometry?: {type:"Point", coordinates: [ 1.0, 2.0, 3.0 ] }
  • try: db.locations.insert({"loc": {"type": "Point", "coordinates" : [ 1,2 ]}})
  • which is fine
Participants:

 Description   

Creating a 2dsphere index fails if the coordinates part of the documents has 3 coordinates. Having 3 or more coordinates is valid geojson as stated in the spec:
A position is represented by an array of numbers. There must be at least two elements, and may be more. The order of elements must follow x, y, z order (easting, northing, altitude for coordinates in a projected coordinate reference system, or longitude, latitude, altitude for coordinates in a geographic coordinate reference system). Any number of additional elements are allowed – interpretation and meaning of additional elements is beyond the scope of this specification.



 Comments   
Comment by Daniel Pasette (Inactive) [ 21/Nov/15 ]

This was fixed in SERVER-9220 and backported to v3.0.3

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