[postgis-users] querying a shapefile imported into postgresql/postgis

Brent Wood pcreso at pcreso.com
Mon Jan 23 12:50:14 PST 2006



--- Markus Schaber <schabi at logix-tt.com> wrote:

> Hello, First,
> 
> First Last wrote:
> > i'm just wondering, what happens to the coordinate values of a
> > shapefile that is imported into postgresql-postgis? my shapefile is a
> > world map in raw (geographic). so assuming its extent is 180E,90S -
> > 180W,90N, does it become -180,-90 - 180, 90 when imported or 0,0 -
> > 360, 180?
> 
> No, the ordinates will be imported 1:1. However, you should pass a
> suitable SRID to shp2pgsql so the data can be interpreted in the correct
> coordinate reference system.

Proj4 (the reprojection engine used by PostGIS) "prefers" +-180 in my (New
Zealand) experience. At least using the standard SRID for lat/long WGS84 data,
4326.

Note, however, there is a new function in PostGIS called shiftlongitude which
swaps between +-180 & 0-360 longitudes so you can store one and extract the
other as you require. 

Cheers,
  
   Brent Wood



More information about the postgis-users mailing list