[postgis-users] Postgis - Line to Point distance

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Fri Jul 10 07:21:20 PDT 2009


Peter Kukuča wrote:

> What is done in the example is a calculation of the distance represented 
> by 1 degree of longitude at two different latitudes. While the distance 
> at zero latitude is correct, the distance at 60° latitude should be 
> exactly half that. The funny part is, that I get the same result with 
> simple point to point calculations. And the absolutely best part is, 
> when I swap all latitudes and longitudes, it works. Now the only 
> reasonable explanation is, that all of the functions take longitude as 
> their first parameter and latitude as the second, but isn't this the 
> other way around?

Nope. PostGIS uses the computer standard of X followed by Y. Hence for 
"POINT(X Y)", X is longitude (or eastings) and Y is latitude (or 
northings). This is true for all PostGIS functions, and I believe is the 
same for all spatial databases too.


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063



More information about the postgis-users mailing list