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)); }
/// <summary>OGC equals.</summary> /// <remarks> /// OGC equals. Performs topological comparison with tolerance. /// This is different from equals(Object), that uses exact comparison. /// </remarks> public virtual bool Equals(com.epl.geometry.ogc.OGCGeometry another) { if (this == another) { return(true); } if (another == null) { return(false); } com.epl.geometry.Geometry geom1 = GetEsriGeometry(); com.epl.geometry.Geometry geom2 = another.GetEsriGeometry(); return(com.epl.geometry.GeometryEngine.Equals(geom1, geom2, GetEsriSpatialReference())); }
public override bool Equals(object other) { if (other == null) { return(false); } if (other == this) { return(true); } if (other.GetType() != GetType()) { return(false); } com.epl.geometry.ogc.OGCGeometry another = (com.epl.geometry.ogc.OGCGeometry)other; com.epl.geometry.Geometry geom1 = GetEsriGeometry(); com.epl.geometry.Geometry geom2 = another.GetEsriGeometry(); if (geom1 == null) { if (geom2 != null) { return(false); } } else { if (!geom1.Equals(geom2)) { return(false); } } if (esriSR == another.esriSR) { return(true); } if (esriSR != null && another.esriSR != null) { return(esriSR.Equals(another.esriSR)); } return(false); }
public OGCConcreteGeometryCollection(com.epl.geometry.ogc.OGCGeometry geom, com.epl.geometry.SpatialReference sr) { geometries = new System.Collections.Generic.List <com.epl.geometry.ogc.OGCGeometry>(1); geometries.Add(geom); esriSR = sr; }
public static com.epl.geometry.ogc.OGCGeometry CreateFromOGCStructure(com.epl.geometry.OGCStructure ogcStructure, com.epl.geometry.SpatialReference sr) { System.Collections.Generic.List <com.epl.geometry.ogc.OGCConcreteGeometryCollection> collectionStack = new System.Collections.Generic.List <com.epl.geometry.ogc.OGCConcreteGeometryCollection>(0); System.Collections.Generic.List <com.epl.geometry.OGCStructure> structureStack = new System.Collections.Generic.List <com.epl.geometry.OGCStructure>(0); System.Collections.Generic.List <int> indices = new System.Collections.Generic.List <int>(0); com.epl.geometry.ogc.OGCGeometry[] geometries = new com.epl.geometry.ogc.OGCGeometry[1]; com.epl.geometry.ogc.OGCConcreteGeometryCollection root = new com.epl.geometry.ogc.OGCConcreteGeometryCollection(java.util.Arrays.AsList(geometries), sr); structureStack.Add(ogcStructure); collectionStack.Add(root); indices.Add(0); while (!structureStack.IsEmpty()) { com.epl.geometry.OGCStructure lastStructure = structureStack[structureStack.Count - 1]; if (indices[indices.Count - 1] == lastStructure.m_structures.Count) { structureStack.Remove(structureStack.Count - 1); collectionStack.Remove(collectionStack.Count - 1); indices.Remove(indices.Count - 1); continue; } com.epl.geometry.ogc.OGCConcreteGeometryCollection lastCollection = collectionStack[collectionStack.Count - 1]; com.epl.geometry.ogc.OGCGeometry g; int i = indices[indices.Count - 1]; int type = lastStructure.m_structures[i].m_type; switch (type) { case 1: { g = new com.epl.geometry.ogc.OGCPoint((com.epl.geometry.Point)lastStructure.m_structures[i].m_geometry, sr); lastCollection.geometries[i] = g; indices[indices.Count - 1] = i + 1; break; } case 2: { g = new com.epl.geometry.ogc.OGCLineString((com.epl.geometry.Polyline)lastStructure.m_structures[i].m_geometry, 0, sr); lastCollection.geometries[i] = g; indices[indices.Count - 1] = i + 1; break; } case 3: { g = new com.epl.geometry.ogc.OGCPolygon((com.epl.geometry.Polygon)lastStructure.m_structures[i].m_geometry, 0, sr); lastCollection.geometries[i] = g; indices[indices.Count - 1] = i + 1; break; } case 4: { g = new com.epl.geometry.ogc.OGCMultiPoint((com.epl.geometry.MultiPoint)lastStructure.m_structures[i].m_geometry, sr); lastCollection.geometries[i] = g; indices[indices.Count - 1] = i + 1; break; } case 5: { g = new com.epl.geometry.ogc.OGCMultiLineString((com.epl.geometry.Polyline)lastStructure.m_structures[i].m_geometry, sr); lastCollection.geometries[i] = g; indices[indices.Count - 1] = i + 1; break; } case 6: { g = new com.epl.geometry.ogc.OGCMultiPolygon((com.epl.geometry.Polygon)lastStructure.m_structures[i].m_geometry, sr); lastCollection.geometries[i] = g; indices[indices.Count - 1] = i + 1; break; } case 7: { geometries = new com.epl.geometry.ogc.OGCGeometry[lastStructure.m_structures[i].m_structures.Count]; g = new com.epl.geometry.ogc.OGCConcreteGeometryCollection(java.util.Arrays.AsList(geometries), sr); lastCollection.geometries[i] = g; indices[indices.Count - 1] = i + 1; structureStack.Add(lastStructure.m_structures[i]); collectionStack.Add((com.epl.geometry.ogc.OGCConcreteGeometryCollection)g); indices.Add(0); break; } default: { throw new System.NotSupportedException(); } } } return(root.geometries[0]); }
public virtual com.epl.geometry.ogc.OGCGeometry SymDifference(com.epl.geometry.ogc.OGCGeometry another) { com.epl.geometry.Geometry geom1 = GetEsriGeometry(); com.epl.geometry.Geometry geom2 = another.GetEsriGeometry(); return(CreateFromEsriGeometry(com.epl.geometry.GeometryEngine.SymmetricDifference(geom1, geom2, GetEsriSpatialReference()), esriSR)); }
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)); }
// analysis public virtual double Distance(com.epl.geometry.ogc.OGCGeometry another) { com.epl.geometry.Geometry geom1 = GetEsriGeometry(); com.epl.geometry.Geometry geom2 = another.GetEsriGeometry(); return(com.epl.geometry.GeometryEngine.Distance(geom1, geom2, GetEsriSpatialReference())); }
public virtual bool Relate(com.epl.geometry.ogc.OGCGeometry another, string matrix) { com.epl.geometry.Geometry geom1 = GetEsriGeometry(); com.epl.geometry.Geometry geom2 = another.GetEsriGeometry(); return(com.epl.geometry.GeometryEngine.Relate(geom1, geom2, GetEsriSpatialReference(), matrix)); }
public virtual bool Overlaps(com.epl.geometry.ogc.OGCGeometry another) { com.epl.geometry.Geometry geom1 = GetEsriGeometry(); com.epl.geometry.Geometry geom2 = another.GetEsriGeometry(); return(com.epl.geometry.GeometryEngine.Overlaps(geom1, geom2, GetEsriSpatialReference())); }
public virtual bool Intersects(com.epl.geometry.ogc.OGCGeometry another) { return(!Disjoint(another)); }
public virtual bool Equals(com.epl.geometry.ogc.OGCGeometry another) { return(Equals(another)); }