[postgis-users] issue with pgsql2shp

John Cole john.cole at uai.com
Mon Jun 5 09:53:17 PDT 2006


Strk,
  Thanks for the reply.  On issue 1) I am using the query and getting the
error about the geometry types (unless you are talking about using a
sub-query).

  With SnapToGrid in issue 2) will it eliminate any points that snap to the
same point?

  On issue 3) the Segmentize returns [multi]polygons according to the
documentation, will it also work on lines and return those as well?

Thanks,

John

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
strk at refractions.net
Sent: Monday, June 05, 2006 8:56 AM
To: 'PostGIS Users Discussion'
Subject: Re: [postgis-users] issue with pgsql2shp

On Fri, Jun 02, 2006 at 09:05:46AM -0500, John Cole wrote:
> 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.

You can use a query instead of a tablename.

> 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.

I suggest SnapToGrid() for pixel-based precision reduction.
Use a grid's cell size equal to your pixel size.

> 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.

Could this be segmentize() ?

--strk;
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
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