[DOCS-1367] Comment on: "manual/core/2d.txt" Created: 10/Apr/13 Updated: 03/Nov/17 Resolved: 16/Apr/13 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jeff lee | Assignee: | Thomas Rueckstiess |
| Resolution: | Done | Votes: | 0 |
| Labels: | collector-298ba4e7 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Location: http://docs.mongodb.org/manual/core/2d/ |
||
| Participants: | |
| Days since reply: | 10 years, 45 weeks ago |
| Description |
|
Hi, The 2.4 docs indicate that 2d indexes should be in the order: longitude, latitude. I'm almost positive that this is the wrong order for 2d indexes. I believe the new order is long/lat for 2dsphere indexes, but that the 2d index order must be lat/long. Can you confirm? |
| Comments |
| Comment by Jeff lee [ 10/Apr/13 ] |
|
Ouch...ok. It took me a few re-reads but I think I understand what the original intent was in that documentation. Thanks for the clarification. |
| Comment by Fredrik Björk [ 10/Apr/13 ] |
|
The documentation for 2d indexes is correct for 2.2 and above, I think the documentation should be clearer for 2.x and below that the order is lat, lon. |
| Comment by Thomas Rueckstiess [ 10/Apr/13 ] |
|
Hi Jeff, The order of arguments is [longitude, latitude] for both 2d and 2dsphere indexes. The wiki page you linked to is a very old version of the docs. That version of the page appears to be inconsistent, because further down, it also states:
If you skip forward in the version history of this page, you will see that a later version has this sentence and the example above fixed: https://wiki.10gen.com/pages/viewpage.action?pageId=22348147 The current v2.2 documentation on the 2d index also states that the order is longitude first, then latitude. This is compliant with the GeoJSON specification. Let me know if you have any follow-up questions. Best regards, |
| Comment by Jeff lee [ 10/Apr/13 ] |
|
Found a copy of the old docs: https://wiki.10gen.com/pages/viewpage.action?pageId=21268125#GeospatialIndexing-CreatingtheIndex "By default, the index assumes you are indexing latitude/longitude and is thus configured for a [-180..180] value range." That matches my experience with 2d indexes. |