[postgis-users] ST_Touches and line segment

Kevin Neufeld kneufeld at refractions.net
Thu Mar 19 09:38:33 PDT 2009

Martin Davis wrote:
> Kevin Neufeld wrote:
>> If you have overlapping polygons then use ST_Relate with a custom 
>> matrix.  IE. ST_Relate(g1, g2, '****1****') will return TRUE for all 
>> geometry pairs where the intersection of the boundaries occur on a 
>> line (1).
> You need to know the type of the input geometries.   The above pattern 
> will work for polygons, but not for lines.  The L/L and P/L situation 
> require different patterns:
> L/L: 1********
> P/L: ***1*****

Ah, yes, of course :)
The symmetric relation is also true:

L/P: *1*******

-- Kevin

More information about the postgis-users mailing list