[postgis-devel] Issue 148 in postgis: st_touches doesn't work as it should on st_touches(line, point)

Kevin Neufeld kneufeld at refractions.net
Wed Apr 8 11:12:00 PDT 2009


nicklas.aven at jordogskog.no wrote:
> The problem I think, is to see is why a multipoint of endpoints is the 
> boundarie of a line, and why a point have interior but no boundarie. I 
> don't see the logic but I guess it is just definitions that have to be done.
>  

If you think about it in terms of dimensionality, I think it makes sense, or at least, easier to remember.

First, some point set theory definitions:
A point has a dimension of 0
A line has a dimension of 1
A polygon has a dimension of 2.

The boundary of a geometry is the set of geometries of the next lower dimension.
The interior of a geometry is the set of geometries that are left with then boundary is removed (or rather, not considered).

So for a polygon (a dimension of 2), the boundary is the linework (a dimension of 1) that makes up the polygon.
For a linestring (a dimension of 1), the boundary is the endpoints (a dimension of 0).
For a point (a dimension of 0), the boundary is, well, nothing, because you can't have a dimension less than 0.

GeoTools has a little write up about this here (that I would love to see in the PostGIS docs some day):
http://docs.codehaus.org/display/GEOTDOC/Point+Set+Theory+and+the+DE-9IM+Matrix

Also, have you seen the ST_Touches examples here?
http://postgis.refractions.net/documentation/manual-svn/ST_Touches.html

Cheers,
Kevin



More information about the postgis-devel mailing list