[postgis-users] clipping and dumping

Shoaib Burq hydromap at gmail.com
Mon Jan 9 07:21:12 PST 2006


Hi

I'm fairly new to PostGIS.  Am running the most recent PostGIS release
with Postgres 8.1 on linux.

I had a rather large shapefile (500MB) which I loaded into the PostGIS
db using shp2pgsql. I want to now clip it using a bounding box to
create a new geometry.

I used the following query:

CREATE TABLE cont25_a AS SELECT c.gid, c.version, c.igds_level,
c.igds_color, c.as2482, c.height, c.sourced, c.sourcea, c.entity
intersection( geomfromtext(
'POLYGON((140.864607446442 -36.1766451540338,
150.146522341991  -36.1766451540338,
150.146522341991  -33.904044258012,
140.864607446442  -33.904044258012,
140.864607446442  -36.1766451540338))'), c.the_geom) AS the_geom,
FROM cont25tbl AS c;

Firstly is this query correct? It appears to have worked successfully.
When I try to dump the clipped geometry using pgsql2shp I get the
following error:

$ pgsql2shp CFA cont25_a -f cont25_a
Initializing... type 'GEOMETRYCOLLECTION' is not Supported at this time.
The DBF file will be created but not the shx or shp files.
You've found a bug! (pgsql2shp.c:2708)

Unfortunately I can't connect to the db using a tool like uDig or QGIS
due to firewall restrictions.

Also, what's the diff between this geometrycollection and the geometry column?
- sb



More information about the postgis-users mailing list