[postgis-users] Can I Clip Layers?

Darren Houston dhouston at beyondcompliance.ca
Thu Mar 25 15:31:03 PST 2004

Hello strk,

Thank you for your answer.

The intersects() function is the function I have been using. The problem is
that it will show the whole geometry, not "clip" the geometry at the extent of
the BOX3D or polygon. I have included some pictures of my output that shows
the river and grid system outside my polygon because intersects() returns true
for an intersecting geometry, and hence my sql returns the whole geometry. I
could "fake it" for now and draw a white square outside my polygon area to
cover anything outside. Ideally, it would be grand if there was some way
PostGIS could clip one layer based on another. I hope I explained myself well,
if not the pictures should help.

Thank you for your help,

Darren H.

strk (strk at keybit.net) wrote:
> On Wed, Mar 24, 2004 at 11:31:33PM -0700, Darren Houston wrote:
> > Hello everyone,
> >
> > I need to know if you can clip a "layer" with a BOX3D in PostGIS. I have a
> > water network (multilines and multipolygons) with some of the spatial entities
> > included in the BOX3D running over the extents of the BOX3D. I must show these
> > spatial entities up to the BOX3D, but no more. For those of you familiar, I
> > need this to work just like the clip function in ArcGIS.
> >
> > I would have researched this on my own, but a client just re-scheduled the
> > demo for this Friday, instead of next Wednesday. There goes my weekend (and
> > sleep)!
> >
> > Thank you for any help,
> >
> > Darren H.
> select intersect(<geometry>,<box3d>);
> If <box3d> is not a valid arg make it a polygon instead.
> You need GEOS.
> --strk;
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: intersects_function_results.jpg
Type: image/pjpeg
Size: 19614 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20040325/33930f8b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: intersects_function_results.png
Type: image/x-png
Size: 19008 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20040325/33930f8b/attachment-0001.bin>

More information about the postgis-users mailing list