/// <summary> /// Determines whether a <see cref="IGeometry" /> instance is spatially within another <see cref="IGeometry" />. /// </summary> /// <param name="geometry">The geometry.</param> /// <param name="otherGeometry">The other geometry.</param> /// <returns><c>true</c> if the geometry is spatially within the other geometry; otherwise, <c>false</c>.</returns> /// <exception cref="System.ArgumentNullException"> /// The geometry is null. /// or /// The other geometry is null. /// </exception> /// <exception cref="System.ArgumentException"> /// The reference system of two geometries are different. /// or /// The operation is not supported with the specified geometry type. /// </exception> public static Boolean Within(this IGeometry geometry, IGeometry otherGeometry) { if (geometry == null) { throw new ArgumentNullException("geometry", "The geometry is null."); } if (otherGeometry == null) { throw new ArgumentNullException("otherGeometry", "The other geometry is null."); } using (IGeometryRelateOperator op = GetRelateOperator(geometry)) { return(op.Within(geometry, otherGeometry)); } }
public void Setup() { _factory = new GeometryFactory(); _operator = new HalfedgeGeometryRelateOperator(); }