[postgis-users] OGR2OGR srid being ignored

Frank Warmerdam warmerdam at pobox.com
Thu Jul 10 11:17:47 PDT 2008

Sufficool, Stanley wrote:
> I import / synchronize data from ARC/INFO coverage files frequently. I 
> use the following command to pull in the data for our intranet mapping 
> server, but it does not seem to honor the SRID arguments and places all 
> geometries with SRID = 32767. I have tried every combination of  
> -*_srs args to no avail.  What am I missing here?
> ogr2ogr -overwrite -f PostgreSQL PG:\"host=<host> dbname=postgis 
> user=postgres password=<iwonttell>" /mnt/gis/covers/precinct pal -nln 
> precinct_tmp -s_srs EPSG:2229 -a_srs EPSG:2229 -t_srs EPSG:2229  -lco 


The EPSG codes are not PostGIS SRIDs!  Internally OGR expands these requests
into WKT and then it does a check against the spatial_ref_sys table to see
if it finds an exact match. If not, it creates a new spatial_ref_sys entry.

It takes surprisingly minor differences in the coordinate system
definition (such as subtle rounding errors in some parameters) to cause
matches to fail.

It has een my intent to add a layer creation option to force selection of
a particular SRID for the PG driver, but apparently this has not been
implemented.  So, basically, you have no way to force use of a particular
SRID now.

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

More information about the postgis-users mailing list