MapGuide API Reference
 All Classes Functions Variables Enumerations Enumerator Friends
virtual MgGeometry* MgGeometry::Difference ( MgGeometry other) [virtual]

Returns a geometry that represents a point set difference between this geometric entity and another.

.NET Syntax
virtual MgGeometry Difference(MgGeometry other);
Java Syntax
virtual MgGeometry Difference(MgGeometry other);
PHP Syntax
virtual MgGeometry Difference(MgGeometry other);
Parameters:
other(MgGeometry) The MgGeometry to subtract from this one.
Returns:
An MgGeometry representing the difference.

Illustration

if (Geom1.Disjoint(Geom2) == True) then Geom1.Difference(Geom2) = Geom1.
if (Geom1.Touches(Geom2) == True) then Geom1.Difference(Geom2) = Geom1.
if (Geom1.Crosses(Geom2) == True) then

diffWhenCrosses.png


if (Geom1.Within(Geom2) == True) then

diffWhenWithin.png

if (A.Overlaps(B) == True) then

diffWhenOverlaps.png