internal static com.epl.geometry.Geometry PolylineMinusArea_(com.epl.geometry.Geometry geometry, com.epl.geometry.Geometry area, int area_type, com.epl.geometry.SpatialReference sr, com.epl.geometry.ProgressTracker progress_tracker) { // construct the complement of the Polygon (or Envelope) com.epl.geometry.Envelope envelope = new com.epl.geometry.Envelope(); geometry.QueryEnvelope(envelope); com.epl.geometry.Envelope2D env_2D = new com.epl.geometry.Envelope2D(); area.QueryEnvelope2D(env_2D); envelope.Merge(env_2D); double dw = 0.1 * envelope.GetWidth(); double dh = 0.1 * envelope.GetHeight(); envelope.Inflate(dw, dh); com.epl.geometry.Polygon complement = new com.epl.geometry.Polygon(); complement.AddEnvelope(envelope, false); com.epl.geometry.MultiPathImpl complementImpl = (com.epl.geometry.MultiPathImpl)(complement._getImpl()); if (area_type == com.epl.geometry.Geometry.GeometryType.Polygon) { com.epl.geometry.MultiPathImpl polygonImpl = (com.epl.geometry.MultiPathImpl)(area._getImpl()); complementImpl.Add(polygonImpl, true); } else { complementImpl.AddEnvelope((com.epl.geometry.Envelope)(area), true); } com.epl.geometry.OperatorFactoryLocal projEnv = com.epl.geometry.OperatorFactoryLocal.GetInstance(); com.epl.geometry.OperatorIntersection operatorIntersection = (com.epl.geometry.OperatorIntersection)projEnv.GetOperator(com.epl.geometry.Operator.Type.Intersection); com.epl.geometry.Geometry difference = operatorIntersection.Execute(geometry, complement, sr, progress_tracker); return(difference); }
/// <summary> /// Constructs the set-theoretic intersection between an array of geometries /// and another geometry. /// </summary> /// <remarks> /// Constructs the set-theoretic intersection between an array of geometries /// and another geometry. /// See OperatorIntersection (also for dimension specific intersection). /// </remarks> /// <param name="inputGeometries">An array of geometry objects.</param> /// <param name="geometry">The geometry object.</param> /// <returns>Any array of geometry objects showing the intersection.</returns> internal static com.epl.geometry.Geometry[] Intersect(com.epl.geometry.Geometry[] inputGeometries, com.epl.geometry.Geometry geometry, com.epl.geometry.SpatialReference spatialReference) { com.epl.geometry.OperatorIntersection op = (com.epl.geometry.OperatorIntersection)factory.GetOperator(com.epl.geometry.Operator.Type.Intersection); com.epl.geometry.SimpleGeometryCursor inputGeometriesCursor = new com.epl.geometry.SimpleGeometryCursor(inputGeometries); com.epl.geometry.SimpleGeometryCursor intersectorCursor = new com.epl.geometry.SimpleGeometryCursor(geometry); com.epl.geometry.GeometryCursor result = op.Execute(inputGeometriesCursor, intersectorCursor, spatialReference, null); System.Collections.Generic.List <com.epl.geometry.Geometry> resultGeoms = new System.Collections.Generic.List <com.epl.geometry.Geometry>(); com.epl.geometry.Geometry g; while ((g = result.Next()) != null) { resultGeoms.Add(g); } com.epl.geometry.Geometry[] resultarr = resultGeoms.ToArray(); return(resultarr); }
/// <summary>Creates a geometry through intersection between two geometries.</summary> /// <remarks> /// Creates a geometry through intersection between two geometries. /// See OperatorIntersection. /// </remarks> /// <param name="geometry1">The first geometry.</param> /// <param name="intersector">The geometry to intersect the first geometry.</param> /// <param name="spatialReference">The spatial reference of the geometries.</param> /// <returns>The geometry created through intersection.</returns> public static com.epl.geometry.Geometry Intersect(com.epl.geometry.Geometry geometry1, com.epl.geometry.Geometry intersector, com.epl.geometry.SpatialReference spatialReference) { com.epl.geometry.OperatorIntersection op = (com.epl.geometry.OperatorIntersection)factory.GetOperator(com.epl.geometry.Operator.Type.Intersection); com.epl.geometry.Geometry result = op.Execute(geometry1, intersector, spatialReference, null); return(result); }
public virtual com.epl.geometry.ogc.OGCGeometry Intersection(com.epl.geometry.ogc.OGCGeometry another) { com.epl.geometry.OperatorIntersection op = (com.epl.geometry.OperatorIntersection)com.epl.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.epl.geometry.Operator.Type.Intersection); com.epl.geometry.GeometryCursor cursor = op.Execute(GetEsriGeometryCursor(), another.GetEsriGeometryCursor(), GetEsriSpatialReference(), null, 7); return(com.epl.geometry.ogc.OGCGeometry.CreateFromEsriCursor(cursor, esriSR, true)); }