Parameters
- geometry1
- The base geometry.
- geometry2
- The comparison geometry.
Return Value
True if geometry1 is within geometry2.
| Exception | Description |
|---|---|
| System.ArgumentNullException | Either geometry1 or geometry2 or both are null. |
| System.NotImplementedException | The method is not implemented for GeometryBag. |
| System.InvalidOperationException | Incompatible spatial references between the input geometries. |
If the geometry2 is empty, then geometry1 is not within geometry2.
If geometry1 is empty and geometry2 is not empty, then geometry1 is within geometry2.
Within is the opposite of Contains. That is, geometry1 is within geometry2 if and only if geometry2 contains geometry1.

Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)