AutoCAD Map 3D 2009 Geospatial Platform Reference

AutoCAD Map 3D Geospatial Platform API

virtual bool MgGeometry::Touches ( MgGeometry other  )  [virtual]

Given 2 geometries a and b, a.Touches(b) is true if and only if the intersection of the interior of a and the interior of b is empty and the intersection of a and b is not empty.

Remarks:
A Point cannot touch a Point because a Point has no boundary and so the intersection of the interiors of the two geometries is not empty.
A Point can touch a non-closed Line at one of the end points of the Line.
A Point cannot touch a closed Line because all of the points in the Line are interior to it.

Illustration

e are MultiPoint geometries and f is a LineString.
touches.png

.NET Syntax
virtual bool Touches(MgGeometry other);
Java Syntax
virtual boolean Touches(MgGeometry other);
PHP Syntax
virtual bool Touches(MgGeometry other);

Parameters:
other (MgGeometry) The MgGeometry to test against this one.
Returns:
True if this geometry spatially touches the other geometry, false otherwise.