[gdal-dev] OGR is not able to determine PostGIS table SRS

Sorokine, Alexandre sorokina at ornl.gov
Tue Jul 7 17:56:21 EDT 2009


Folks,

I am trying to determine an SRS for a table in PostGIS database but I am
getting NULL.  I have a table that in PostGIS that has SRID defined:

usa=# select ST_SRID(the_geom) from census.counties;
 st_srid 
---------
    4326
    4326
...

However, when I try to do OGR_L_GetSpatialRef() or
OGR_L_GetSpatialReference() I am always getting NULL.  Same on ogrinfo:

ogrinfo -al -ro PG:'host=geodb dbname=usa tables=census.counties'
INFO: Open of `PG:host=geodb dbname=usa tables=census.counties'
      using driver `PostgreSQL' successful.
INFO: Internal data source name `PG:host=geodb dbname=usa '
      different from user name `PG:host=geodb dbname=usa tables=census
.counties'.

Layer name: census.counties
Geometry: Unknown (any)
Feature Count: 3141
Extent: (-178.217606, 18.921785) - (-66.969269, 71.406242)
Layer SRS WKT:
(unknown)
FID Column = gid
Geometry Column = the_geom
age_18_21: Integer (0.0)
age_22_29: Integer (0.0)
...

Result is the same on gdal versions 1.4.4, 1.6.0, 1.6.1 on OSX and Ubuntu
8.04.

Am I doing something wrong?

-- 
Alex Sorokine
mailto:SorokinA at ornl.gov




More information about the gdal-dev mailing list