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

Returns a geometry that represents the point set symmetric difference of this geometry with another.

.NET Syntax
virtual MgGeometry SymetricDifference(MgGeometry other);
Java Syntax
virtual MgGeometry SymetricDifference(MgGeometry other);
PHP Syntax
virtual MgGeometry SymetricDifference(MgGeometry other);
Parameters:
other(MgGeometry) The MgGeometry to subtract from this one.
Remarks:
As of 3.0 the resulting geometry, if it is an aggregate geometry will have its sub-geometries ordered based on the order of your operand geometries. Take note of this if your code is concerned about the order of geometries in the symmetric difference result
Returns:
An MgGeometry representing the symmetric difference.

Illustration

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

A B SymDiff
Point | MultiPoint Point | MultiPoint MultiPoint
Point | MultiPoint LineString | MultiLineString Geometry Collection (MultiLineString Point+, LineString+)
Point | MultiPoint Polygon | MultiPolygon Geometry Collection (Point+, Polygon+)
LineString | MultiLineString LineString | MultiLineString MultiLineString
LineString |MultiLineString Polygon | MultiPolygon Geometry Collection (LineString+, Polygon+)
Polygon | MultiPolygon Polygon | MultiPolygon MultiPolygon


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

symmetricDiffWhenTouches.png


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

symmetricDiffWhenCrosses.png


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

symmetricDiffWhenWithin.png


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

symmetricDiffWhenOverlaps.png