[postgis] Re: How to use pgsql2shp

lr1234567 lr1234567 at yahoo.com
Thu Dec 6 09:21:05 PST 2001


Jeff,

That part I understand about the limitation of shp, but the geometry 
table I was joining with only has one type of geometry 
(multipolygons) - and that is the geometry field I am selecting in my 
view.  The other table I am joining with has no geometries.

My view query looks something like this

SELECT ap.*, l.the_geom
FROM ap INNER JOIN landparcels l ON ap.parcelid = l.parcelid


landparcels is the one with the geometry field of type multipolygon
and ap has no geometries - just a simple postgres table.

I assumed that if I defined my new table remsactive setting the 
geometry type the same as my landparcels, I would only have one type 
of geometry.

Note that if I try to dump out landparcels using pgsql2shp it works 
fine.  Or is the fact that I am inserting from a view posing a 
problem.





--- In postgis at y..., jeff lounsbury <jeffloun at r...> wrote:
> 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 y...
> >
> >
> >
> > Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Tiny Wireless Camera under $80!
Order Now! FREE VCR Commander!
Click Here - Only 1 Day Left!
http://us.click.yahoo.com/75YKVC/7.PDAA/ySSFAA/PhFolB/TM
---------------------------------------------------------------------~->

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