[postgis-users] Intersect?

Bruce Rindahl rindahl at lrcwe.com
Tue May 29 13:06:44 PDT 2007


You could also check if the area of intersection > 0

> SELECT t1.id, t1.name from t1, t2
> 	WHERE t1.the_geom && t2.the_geom
> 	AND area(intersection(t1.the_geom,t2.the_geom)) > 0
> 	AND t2.id = 'S';

Bruce Rindahl

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Martin
Davis
Sent: Tuesday, May 29, 2007 2:02 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Intersect?

It sounds like you want to find all features whose *interiors* 
intersect.  This is a commonly needed spatial search, which for some 
reason the OGC did not provide a named predicate for.  Thus the only way 
to obtain this behaviour is to use raw Relate, as you've realized.

The intersectionPatternMatrix you need is:  "T********"

Stephen Crawford wrote:
> Hi All,
>
> I have a query where I'm trying to get all the features in table 1 that
are
> intersected by a feature in table 2:
>
> SELECT t1.id, t1.name from t1, t2
> 	WHERE t1.the_geom && t2.the_geom
> 	AND intersects(t1.the_geom,t2.the_geom)
> 	AND t2.id = 'S';
>
> This gives me more than I want, in the sense that it returns the features
> "outside" of the feature of choice that share a border.  What I really
want
> are just those features that are "partially contained by".....features
that
> share more than just a border.  It looks like
> Relate(geom,geom,intersectionPatternMatrix) might be what I'm looking for,
> but I have no idea what "intersectionPatternMatrix" means.
>
> Any ideas?
>
> Thanks,
> Steve
>
> Stephen Crawford
> Center for Environmental Informatics
> GeoVISTA Center
> The Pennsylvania State University
> 814.865.9905
> src176 at psu.edu
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>   

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
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