[postgis-users] export polygon to shapefile problem
Thomas Kouk
thomaskouk at yahoo.gr
Wed Nov 17 01:17:13 PST 2010
Hi all,
I am newbie in PostGIS and I have a problem exporting a polygon table in shp. I
want to export specific spatial tables from by database using a batch procedure
(bat file). The command I use is:
pgsql2shp -P [password] -f [shapefile path & name] postgis [tablename], for
example: pgsql2shp -P postgres -f Data\Buffers\ Buffer.shp postgis buffer_table
It works fine with all other spatial tables (linestring or multilinestring
type). For polygons it also seems to work, as I get no error message:
Initializing... Done (postgis major version: 1).
Output shape: Polygon
Dumping: XX [1 rows].
However, when I try to load the polygon shp in Qgis or ArcGIS I get an error:
ArcGIS cannot open the file, while QGIS loads the shp but displays nothing (as
if the table is empty, which is not the case).
All my tables are spatial tables with no information on geometry_columns table,
but even if I add the polygon table in the geometry_columns, nothing changes.
After all, the function works with all other spatial non polygon tables despite
the fact that geometry_columns holds no information on them, so this is not the
problem.
I can load the postgis polygon table in qgis and export it manually to a shp,
which works fine, but I need to do it in an automatic way using a command.
Has anyone come to this problem or is there something I do not know about
exporting polygon tables to shp?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20101117/3c34ed16/attachment.html>
More information about the postgis-users
mailing list