[postgis-users] shp2pgsql - reversing x,y coordinates?

Michael Fuhr mike at fuhr.org
Tue Aug 1 20:04:53 PDT 2006


On Tue, Aug 01, 2006 at 04:39:17PM -0400, Peter Fay wrote:
> You are getting the same results as me.  The first point is
>  180 68.993782043457
> I assumed x = latitude, y = longitude, but the reverse is true: x =
> longitude, y = latitude (since 180 cannot be a latitude).
> 
> I guess all shapefiles are organized (longitude, latitude).  I guess this is
> the way it's supposed to be?

According to the shapefile technical description[1], "A point
consists of a pair of double-precision coordinates in the order
X, Y."  The description doesn't mention longitude or latitude, but
in longlat projections longitude is conventionally the horizontal
(X) axis.  It might be formally defined as such somewhere but I
don't have a reference handy.

[1] http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf

-- 
Michael Fuhr



More information about the postgis-users mailing list