[postgis-users] Can I Clip Layers?

Darren Houston dhouston at beyondcompliance.ca
Thu Mar 25 16:21:55 PST 2004


Hello Dave and strk,

This is exactly what I want. Works perfect. Now, time to approach accounting
and demand a faster server :)!

Thank you for your help,

Darren H.

David Blasby (dblasby at refractions.net) wrote:
>
> Darren Houston wrote:
> > 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.
> >
>
>
> SELECT intersection(the_Geom, <box3d>) FROM <table> WHERE the_Geom &&
> <box3d>;
>
> this should do what you want.
>
> dave
> _______________________________________________
> 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