Within

Geometry.Within method (1 of 2)

Determines whether this geometry is within a specified extent.

public bool Within(Extent extent)
Parameter Type Description
extent Extent The extent.

Return Value

true if this geometry is within extent; false otherwise.

Exceptions

exception condition
ArgumentNullException Argument is null.

See Also


Geometry.Within method (2 of 2)

Determines whether this geometry is within a specified geometry.

public bool Within(IGeometry other)
Parameter Type Description
other IGeometry A geometry.

Return Value

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

Exceptions

exception condition
ArgumentNullException Argument is null.
ArgumentException One of the geometries is invalid in such way that operation can not be finished.
ArgumentException SpatialReferenceSystem 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