コード例 #1
0
 /// <summary>Calculates the convex hull.</summary>
 /// <remarks>
 /// Calculates the convex hull.
 /// See OperatorConvexHull
 /// </remarks>
 /// <param name="geometries">The input geometry array.</param>
 /// <param name="b_merge">
 /// Put true if you want the convex hull of all the geometries in
 /// the array combined. Put false if you want the convex hull of
 /// each geometry in the array individually.
 /// </param>
 /// <returns>
 /// Returns an array of convex hulls. If b_merge is true, the result
 /// will be a one element array consisting of the merged convex hull.
 /// </returns>
 public static com.epl.geometry.Geometry[] ConvexHull(com.epl.geometry.Geometry[] geometries, bool b_merge)
 {
     com.epl.geometry.OperatorConvexHull   op            = (com.epl.geometry.OperatorConvexHull)factory.GetOperator(com.epl.geometry.Operator.Type.ConvexHull);
     com.epl.geometry.SimpleGeometryCursor simple_cursor = new com.epl.geometry.SimpleGeometryCursor(geometries);
     com.epl.geometry.GeometryCursor       cursor        = op.Execute(simple_cursor, b_merge, 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 = cursor.Next()) != null)
     {
         resultGeoms.Add(g);
     }
     com.epl.geometry.Geometry[] output = new com.epl.geometry.Geometry[resultGeoms.Count];
     for (int i = 0; i < resultGeoms.Count; i++)
     {
         output[i] = resultGeoms[i];
     }
     return(output);
 }
コード例 #2
0
 /// <summary>Calculates the convex hull geometry.</summary>
 /// <remarks>
 /// Calculates the convex hull geometry.
 /// See OperatorConvexHull.
 /// </remarks>
 /// <param name="geometry">The input geometry.</param>
 /// <returns>
 /// Returns the convex hull.
 /// For a Point - returns the same point. For an Envelope -
 /// returns the same envelope. For a MultiPoint - If the point
 /// count is one, returns the same multipoint. If the point count
 /// is two, returns a polyline of the points. Otherwise computes
 /// and returns the convex hull polygon. For a Segment - returns a
 /// polyline consisting of the segment. For a Polyline - If
 /// consists of only one segment, returns the same polyline.
 /// Otherwise computes and returns the convex hull polygon. For a
 /// Polygon - If more than one path, or if the path isn't already
 /// convex, computes and returns the convex hull polygon.
 /// Otherwise returns the same polygon.
 /// </returns>
 public static com.epl.geometry.Geometry ConvexHull(com.epl.geometry.Geometry geometry)
 {
     com.epl.geometry.OperatorConvexHull op = (com.epl.geometry.OperatorConvexHull)factory.GetOperator(com.epl.geometry.Operator.Type.ConvexHull);
     return(op.Execute(geometry, null));
 }
コード例 #3
0
 public virtual com.epl.geometry.ogc.OGCGeometry ConvexHull()
 {
     com.epl.geometry.OperatorConvexHull op     = (com.epl.geometry.OperatorConvexHull)com.epl.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.epl.geometry.Operator.Type.ConvexHull);
     com.epl.geometry.GeometryCursor     cursor = op.Execute(GetEsriGeometryCursor(), true, null);
     return(com.epl.geometry.ogc.OGCGeometry.CreateFromEsriCursor(cursor, esriSR));
 }