FW: [gdal-dev] RE: ogr2ogr PostgreSQL to shp

Randy George rkgeorge at cadmaps.com
Sat Apr 26 15:38:23 EDT 2008


Hi Frank,

> This can happen if you have a geometry_columns table but no entries in it.


Yes, that was the problem. I've been burned on that before so I should have
noticed. It's too easy to use backup/restore when moving from system to
system and forget the geometry_columns update.

Thanks
randy

-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Saturday, April 26, 2008 10:15 AM
To: rkgeorge at cadmaps.com
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] RE: ogr2ogr PostgreSQL to shp

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