[postgis-users] Can't Get a Shapefile from PostGIS Data

Phil Bartie philbartie at gmail.com
Wed May 20 00:50:27 PDT 2009


Hi Bill,

Hopefully something like this should do it....

ogr2ogr -overwrite -a_srs epsg:2232 -f "ESRI Shapefile" d:\mymap.shp
"PG:dbname
=geo host=127.0.0.1 user=postgres password=pass123" -sql "select * from
layer"

Making adjustments for your username, password, and layer name.

Ta,
Phil



On Wed, May 20, 2009 at 6:22 PM, Bill Thoen <bthoen at gisnet.com> wrote:

> I must be overlooking something simple, but I can't seem to get a PostGIS
> table into an ESRI shapefile. If I use pgsql2shp, I don't get an SRS, but
> when I try ogr2ogr, nothing happens at all. No error, but no data either. So
> what's wrong with this?
>
> ogr2ogr -overwrite -a_srs epsg:2232 -f "ESRI Shapefile" lidar.shp
> PG:dbname=spatial1 las_tiles
>
> When I run this, the system prompt comes back almost immediately (no delay
> to indicate any activity on the database), no file is generated and no
> errors reported on screen or in the PG serverlog file.
>
> I'm using PostgreSQL 8.3.3 on Linux.
>
> Any help would be much appreciated, 'cause I just don't see what's wrong
> here.
>
> TIA,
> - Bill Thoen
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090520/d5cc732a/attachment.html>


More information about the postgis-users mailing list