/// <summary>Constructs a new geometry by union an array of geometries.</summary> /// <remarks> /// Constructs a new geometry by union an array of geometries. All inputs /// must be of the same type of geometries and share one spatial reference. /// See OperatorUnion. /// </remarks> /// <param name="geometries">The geometries to union.</param> /// <param name="spatialReference">The spatial reference of the geometries.</param> /// <returns>The geometry object representing the resultant union.</returns> public static com.epl.geometry.Geometry Union(com.epl.geometry.Geometry[] geometries, com.epl.geometry.SpatialReference spatialReference) { com.epl.geometry.OperatorUnion op = (com.epl.geometry.OperatorUnion)factory.GetOperator(com.epl.geometry.Operator.Type.Union); com.epl.geometry.SimpleGeometryCursor inputGeometries = new com.epl.geometry.SimpleGeometryCursor(geometries); com.epl.geometry.GeometryCursor result = op.Execute(inputGeometries, spatialReference, null); return(result.Next()); }
public virtual com.epl.geometry.ogc.OGCGeometry Union(com.epl.geometry.ogc.OGCGeometry another) { com.epl.geometry.OperatorUnion op = (com.epl.geometry.OperatorUnion)com.epl.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.epl.geometry.Operator.Type.Union); com.epl.geometry.GeometryCursorAppend ap = new com.epl.geometry.GeometryCursorAppend(GetEsriGeometryCursor(), another.GetEsriGeometryCursor()); com.epl.geometry.GeometryCursor cursor = op.Execute(ap, GetEsriSpatialReference(), null); return(com.epl.geometry.ogc.OGCGeometry.CreateFromEsriCursor(cursor, esriSR)); }
public static void TestUnion__() { com.epl.geometry.Point pt = new com.epl.geometry.Point(10, 20); com.epl.geometry.Point pt2 = new com.epl.geometry.Point(); pt2.SetXY(10, 10); com.epl.geometry.Envelope env1 = new com.epl.geometry.Envelope(10, 10, 30, 50); com.epl.geometry.Envelope env2 = new com.epl.geometry.Envelope(30, 10, 60, 50); com.epl.geometry.Geometry[] geomArray = new com.epl.geometry.Geometry[] { env1, env2 }; com.epl.geometry.SimpleGeometryCursor inputGeometries = new com.epl.geometry.SimpleGeometryCursor(geomArray); com.epl.geometry.OperatorUnion union = (com.epl.geometry.OperatorUnion)com.epl.geometry.OperatorFactoryLocal.GetInstance().GetOperator(com.epl.geometry.Operator.Type.Union); com.epl.geometry.SpatialReference sr = com.epl.geometry.SpatialReference.Create(4326); com.epl.geometry.GeometryCursor outputCursor = union.Execute(inputGeometries, sr, null); com.epl.geometry.Geometry result = outputCursor.Next(); }