[Django]-What is the reason for a noticable difference between postgis distance function and google maps distance calculator results?

4πŸ‘

βœ…

In one of the calculations, you have specified latitude and longitude the wrong way around. You can test it here to check the results are repeatable if you switch the values around. It’s literally just making sure you know which value is latitude and which is longitude and specifying it correctly to both APIs.

I don’t use the library but this seems to be poorly documented considering how easy this mistake is. You can see more in Does Y mean latitude and X mean longitude in every GIS software?

πŸ‘€roganjosh

0πŸ‘

Does it account for the decreased spherical distance at latitudes as you approach the poles? The correction can be closely approximated by multiplying the distance by cos(latitude) – in this case cos(52.16) = 0.613

πŸ‘€MarkS

Leave a comment