[postgis-users] clipping and dumping

Shoaib Burq hydromap at gmail.com
Mon Jan 9 17:39:19 PST 2006


Thanks Strk,

looking at the ouput from summary there are lots of empty
geometrycollections. I managed to filter them out using the query
filter option in pgsql2shp.

I am very pleased with the results ... I should mention the reason I
loaded the shapefile into PostGIS in the first place was coz I tried
clipping it using ArcGIS9.x but it puked after grinding away for
30mins.

PostGIS (after creating the indices) only took 30 seconds to give me
clipped area I wanted .... haha

PostGIS rocks!
-sb



On 1/10/06, strk at refractions.net <strk at refractions.net> wrote:
> The intersection consists in heterogeneous geometry types
> (polygons and points maybe?) thus a geometrycollection
> is returned.
>
> Check summary() output to see what you got.
>
> --strk;
>
> On Tue, Jan 10, 2006 at 02:21:12AM +1100, Shoaib Burq wrote:
> > 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
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>
> --
>
>  /"\    ASCII Ribbon Campaign
>  \ /    Respect for low technology.
>  X     Keep e-mail messages readable by any computer system.
>  / \    Keep it ASCII.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list