Comparing Geometry Objects

AutoCAD Map 3D Geospatial Platform API

 
Comparing Geometry Objects
 
 
 

The MgGeometry class contains methods for comparing different geometry objects. These are similar to the spatial filters described in Selecting Using the API. Methods to test spatial relationships include:

  • Contains()
  • Crosses()
  • Disjoint()
  • Equals()
  • Intersects()
  • Overlaps()
  • Touches()
  • Within()

For example, if you have an MgLineString object line and an MgPolygon object polygon, you can test if the line crosses the polygon with a call to

line.Crosses(polygon)

Methods to create new geometry objects from the point set of two other geometries include:

  • Difference()
  • Intersection()
  • SymmetricDifference()
  • Union()

Complete details are in the Geometry module of the Geospatial Platform API reference, under Spatial Relationships.