[GODRIVER-2429] GeoJSON uses lat/long in the wrong order Created: 19/May/22  Updated: 27/Oct/23  Resolved: 20/May/22

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Naden Franciscus Assignee: Matt Dale
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DOCS-15351 [Server] Make geospatial coordinate o... Closed

 Description   

Summary

MongoDB calculates the distance between 2 points in Lat, Long order. It uses Latitude for Longitude and Longitude for Latitude in their Point to Point distance calculation

https://blog.icod.de/2022/05/19/serious-bug-in-mongodb-geospatial-distance-calculation/

Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

How to Reproduce

https://github.com/golang/geo/issues/85

 



 Comments   
Comment by Matt Dale [ 19/May/22 ]

Hey naden@harana.com thanks for the ticket! I noticed the original blog post and "golang/geo" Github issue were both updated to indicate the issue was related to using incorrect point coordinate order (e.g. (latitude, longitude) vs (longitude, latitude)) and no longer suggests a bug in the Go Driver. That confusion is understandable because the coordinate order is different in various standards and tools (MongoDB uses GeoJSON, which expects order (longitude, latitude)). Considering that, I filed DOCS-15351 that suggests making the expected coordinate order in MongoDB more prominent in the geospatial operations documentation. Please feel free to leave any comments about the proposed documentation improvement on that ticket.

Were you able to resolve your original issue by switching the latitude and longitude values in your code?
Edit: naden@harana.com I just saw your comment about closing this ticket! Thanks for the update, will close.

Comment by Naden Franciscus [ 19/May/22 ]

I only reported this as the author had issues logging in. But from the blog post it looks like a non-issue and can be closed ?

Generated at Thu Feb 08 08:38:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.