[postgis-users] Can I Clip Layers?

strk strk at keybit.net
Thu Mar 25 08:54:45 PST 2004


Read the postgis manual.
There is intersects() and intersection().
You need the latter.

--strk;

On Thu, Mar 25, 2004 at 04:31:03PM -0700, 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.
> 
> 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
> >



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