[postgis-users] issue with pgsql2shp

John Cole john.cole at uai.com
Fri Jun 2 07:05:46 PDT 2006


I'm trying to create shapefiles from tiger data inside our postgis database
with pgsql2shp.  Since these shapefiles are for rendering with mapserver
only, I'd like to pre-process these so they are optimal for rendering at
certain scales and maximize mapserver performance.  I'm using "1.0
USE_GEOS=1 USE_PROJ=1 USE_STATS=1" of PostGIS.

Here are some issues I've run into:

1)  If I give pgsql2shp a query like "select the_geom from tgr_roads where
cfcc like 'A1%' or cfcc like 'A2%'", I get the following error; ERROR:
Cannot determine geometry type (empty table).  I found a mail list message
from 2003 about adding a -t switch to specify the geometry type, but that
doesn't appear in this version.  I'd like to do this without creating
temporary tables.

2)  I'd like to make reduced resolution shapefiles for certain scales (for
example, at 1M scale, no feature should be shorter than 250 meters, the size
of one pixel on the map).  Does the simplify() function do this?  I have the
following query, which I think does this, but I get the same error as in 1)
above.

select transform(simplify(transform(collect(the_geom),32616),250), 4326) as
the_geom from tgr_roads where cfcc like 'A1%' or cfcc like 'A2%' group by
hwy_num, rd_name

3)  I don't see the equivalent densify() ArcInfo function in PostGIS, is
there one?  When creating reduced resolution shapes, I like to densify they
line to 1-10 meters and then reduce the resolution to 250 meters to ensure
that the original shape of the file is retained.

Thanks,

John Cole 
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.



More information about the postgis-users mailing list