IGeometry.Within

Within(Extent)

Determines whether this geometry is within a specified extent.

public bool Within(Extent extent)
ParameterTypeDescription
extentExtentThe extent.

Return Value

true if this geometry is within extent; false otherwise.

Exceptions

exceptioncondition
ArgumentNullExceptionArgument is null.

See Also


Within(IGeometry)

Determines whether this geometry is within a specified geometry.

public bool Within(IGeometry other)
ParameterTypeDescription
otherIGeometryA geometry.

Return Value

true if this geometry is “spatially within” 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 one geometry is within another in terms of DE-9IM intersection matrix. One geometry is within another one, if another geometry contains every point of the geometry and geometries interiors intersect. This method is equivalent to:

this.Relate(other, "T*F**F***");

See OpenGIS Simple Features Specification for more details about DE-9IM and “spatially within” relation.

See Also