Comparing Geometry Objects

The MgGeometry class contains methods for comparing different geometry objects. These are similar to the spatial filters described in Selecting with the Web 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 Web API reference, under Spatial Relationships.