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); }
public override void QueryEnvelope(com.epl.geometry.Envelope env) { env.SetEmpty(); if (m_description != env.m_description) { env.AssignVertexDescription(m_description); } env.Merge(this); }
// Checked vs. Jan 11, 2011 /// <summary>\internal Updates x, y intervals.</summary> public virtual void _updateXYImpl(bool bExact) { m_envelope.SetEmpty(); com.epl.geometry.AttributeStreamOfDbl stream = (com.epl.geometry.AttributeStreamOfDbl)m_vertexAttributes[0]; com.epl.geometry.Point2D pt = new com.epl.geometry.Point2D(); for (int i = 0; i < m_pointCount; i++) { stream.Read(2 * i, pt); m_envelope.Merge(pt); } }
public override com.epl.geometry.ogc.OGCGeometry Envelope() { com.epl.geometry.GeometryCursor gc = GetEsriGeometryCursor(); com.epl.geometry.Envelope env = new com.epl.geometry.Envelope(); for (com.epl.geometry.Geometry g = gc.Next(); g != null; g = gc.Next()) { com.epl.geometry.Envelope e = new com.epl.geometry.Envelope(); g.QueryEnvelope(e); env.Merge(e); } com.epl.geometry.Polygon polygon = new com.epl.geometry.Polygon(); polygon.AddEnvelope(env, false); return(new com.epl.geometry.ogc.OGCPolygon(polygon, esriSR)); }
public virtual void TestEnvelope2000() { com.epl.geometry.Point[] points = new com.epl.geometry.Point[2000]; System.Random random = new System.Random(69); for (int i = 0; i < 2000; i++) { points[i] = new com.epl.geometry.Point(); points[i].SetX(random.NextDouble() * 100); points[i].SetY(random.NextDouble() * 100); } for (int iter = 0; iter < 2; iter++) { // long startTime = Sharpen.Runtime.NanoTime(); com.epl.geometry.Envelope geomExtent = new com.epl.geometry.Envelope(); com.epl.geometry.Envelope fullExtent = new com.epl.geometry.Envelope(); for (int i_1 = 0; i_1 < 2000; i_1++) { points[i_1].QueryEnvelope(geomExtent); fullExtent.Merge(geomExtent); } // long endTime = Sharpen.Runtime.NanoTime(); } }