[postgis] How to use pgsql2shp

jeff lounsbury jeffloun at refractions.net
Thu Dec 6 09:15:39 PST 2001


This is simply a limitation of the .shp format. The format only allows a file
to consists of homogeneous shape types.
eg  all Points , all MultiPolygons etc...

What you can do if you really need the shapes in .shp format is keep the
different types in separate PostGIS tables and then dump each of the tables.

The other possibility is converting all the shapes to the most complex type.
eg. Just call points multipoints so you can have a single multipoint .shp
file. If the types are very different like points and mutipolygons, this will
probably not work though.
-Jeff

lr1234567 wrote:

> Is there a particular structure that pgsql2shp is expecting
>
> When I try to use it on a table I created it generates the dbf fine,
> but can't generate the shp file
>
> It states as an error, can not have multiple geometry types in a
> shape file.
>
> It works fine on tables I generated using the shp2pgsql loader.
>
> The way I created and populated the table I'm trying to dump out is
> as follows
>
> create table remsactive ( PARCELID varchar(10), ADDRESS varchar,
> NEIGHBORHO varchar, USE varchar, TYPE varchar, STATUS varchar,
> LOTAREA int);
>
> select AddGeometryColumn
> ('dts','remsactive','the_geom','102686','MULTIPOLYGON',2);
>
> INSERT INTO remsactive(gid, parcelid, address, neighborho,use, type,
> status, lotarea, the_geom)
> SELECT gid, parcelid, address,neighborhood, cuse, propertytype,
> status, sqfeet,the_geom
> FROM vwavailableparcels;
>
> _______
> the vwavailableparcels is a view I set up that joins a table of
> multipolygon geometries I loaded from a shape file with a non-
> geometry table.
>
>
> To unsubscribe from this group, send an email to:
> postgis-unsubscribe at yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list