[postgis-users] Finding intersection of polygon line with frame

Chris Faulkner chrisf at oramap.com
Thu Oct 16 22:29:31 PDT 2003


Thanks. That looks like it might be just the thing I need.

Since the intersects function is not being found, I probably don't have the
GEOS module installed. Are there any installation notes for it anywhere ?

Chris

> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net]On Behalf Of David
> Blasby
> Sent: 17 October 2003 00:26
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Finding intersection of polygon line with
> frame
>
>
> Chris Faulkner wrote:
> > This works fine. However, I would like to constrain the
> selection to only
> > those polygons that cross the box3d. So any polygons that are
> wholly within,
> > or entirely covering the box3d, then I would like to reject them. Only
> > polygons whose lines cross the box3d should be included. How do
> I write such
> > a query in postgis ?
>
> Make sure you have GEOS installed and activated.
>
> SELECT * FROM <table> WHERE
>     the_Geom && <polygon> AND
>     intersects(the_Geom, <polygon>) AND
>     not(within(the_geom,<polygon>)
>
> This will find any feature that intersects the polygon, but isnt
> inside it.
>
> To find your <polygon>, either construct it yourself or you can have
> postgis construct it for you:
>
> envelope(GeometryFromText('BOX3D(529000 179000,530000 180000)'::box3d,-1))
>
>
> _______________________________________________
> 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