equals
Returns true if geometries a and b are topologically equal.
Geometry a is topologically equal to geometry b if their interiors
intersect and no part of the interior or boundary of one geometry intersects
the exterior of the other.
That means that the geometries must have the same dimension, and they occupy the same space. They do not need to have the same vertices or even the same type (MultiLine can be equal to Line, GeometryCollection to Polygon etc).
Like other spatial predicates, equals operates in 2D only; it ignores any
Z or M ordinates.
warning
Do not use this function with invalid geometries. You will get unexpected results.
Parameters
| Name | Type | Description |
|---|---|---|
a | Geometry | First geometry |
b | Geometry | Second geometry |
Returns
boolean
true if geometry a is topologically equal to geometry b
Throws
GEOSErroron unsupported geometry types (curved)
See also
equalsExactchecks whether two geometries are of the same type and have the same vertices in the same order on the XY planeequalsIdenticalchecks whether two geometries are of the same type and have exactly the same vertices in the same order on the XYZM plane