Geometry.Crosses

Geometry.Crosses method

Determines if this geometry and a specified geometry cross.

public bool Crosses(IGeometry other)
ParameterTypeDescription
otherIGeometryA geometry.

Return Value

true if this geometry is “spatially crosses” another geometry. false otherwise.

Exceptions

exceptioncondition
ArgumentNullExceptionArgument is null.
ArgumentExceptionOne of the geometries is invalid in such way that operation can not be finished.
ArgumentExceptionSpatialReferenceSystem of geometries are not equivalent. You can use SpatialReferenceSystemTransformation in order to convert geometries to the same spatial reference system.

Remarks

This method tests whether geometries are crosses in terms of DE-9IM intersection matrix. Two geometries cross each other if they have some but not all interior points in common and the dimension of the intersection is less then dimension of at least one of the geometries. That is: two LineStrings cross, if they form an ‘X’ letter, a LineString and a Polygon cross if LineString goes through interior of a Polygon. See OpenGIS Simple Features Specification for more details about DE-9IM and “spatially crosses” relation.

See Also