[postgis-users] Re: touches() not returning correct values, maybe?

Paul Ramsey pramsey at refractions.net
Tue Jan 2 14:17:02 PST 2007


Touches() is only true if the exteriors interact and the interiors do 
not. If your adjacent polygons overlap slightly, then they do not just 
touch.

P.

Jeff D. Hamann wrote:
> This seems to remedy this situation.
> 
> select
>   t1.gid as gid,
>   t2.gid as adj_gid
>  from
>   stands t1,
>   stands t2
>  where
>   intersects( t1.boundary, t2.boundary ) AND
>    t1.boundary && t2.boundary and
>   Equals( t1.boundary, t2.boundary ) is FALSE
> order by
> 	t1.gid,
> 	t2.gid;
> 
> So why is this different than
> 
> select
>   t1.gid as gid,
>   t2.gid as adj_gid
>  from
>   stands t1,
>   stands t2
>  where
>   touches( t1.boundary, t2.boundary ) AND
>    t1.boundary && t2.boundary and
> order by
> 	t1.gid,
> 	t2.gid;
> 
> Jeff.
> 




More information about the postgis-users mailing list