[gdal-dev] RE: ogr2ogr PostgreSQL to shp

Frank Warmerdam warmerdam at pobox.com
Sat Apr 26 12:14:59 EDT 2008


Randy George wrote:
> Hi,
> 
>  
> 
> I’m attempting to extract a subset of a PostGIS table to shp using this 
> windows command line:
> 
>  
> 
> "C:\Program Files\FWTools2.1.0\bin\ogr2ogr" --debug on -where " fips = 
> '08041' " -f "ESRI Shapefile" out.shp PG:"user=user dbname=db 
> host=localhost password=pass port=5432" gnis
> 
>  
> 
> Here is the debug output:
> 
> OGR_PG: DBName="db"
> 
> OGR_PG: PostSIS version string: '1.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1' 
> -> '1.3'
> 
>  
> 
> OGR_PG: POSTGIS_VERSION=1.3 USE_GEOS=1 USE_PROJ=1 USE_STATS=1
> 
> ERROR 1: PG:user=user dbname=db host=localhost password=pass port=54

Randy,

Does ogrinfo on this postgres database work?  The fact that you got the
postgis version info back indicates that the database was successfully
connected to.

Skimming the Postgres driver code, I suspect it failed to identify any
layers in your postgres database.  This can happen if you have a
geometry_columns table but no entries in it.  I'm not sure why else it
might happen.

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 gdal-dev mailing list