@Override public Geometry next() { while (m_collections != null) { if (m_current != null) { Geometry g = m_current.next(); if (g == null) { m_current = null; continue; } return g; } else { m_index++; if (m_index < m_collections.size()) { m_current = m_collections.get(m_index).flatten().getEsriGeometryCursor(); continue; } else { m_collections = null; m_index = -1; } } } return null; }
@Override public Geometry next() { while (m_collections != null) { if (m_current != null) { Geometry g = m_current.next(); if (g == null) { m_current = null; continue; } return g; } else { m_index++; if (m_index < m_collections.size()) { m_current = m_collections.get(m_index).flatten().getEsriGeometryCursor(); continue; } else { m_collections = null; m_index = -1; } } } return null; }
private GeometryCursor prepare_for_ops_(OGCConcreteGeometryCollection collection) { assert(collection != null && !collection.isEmpty()); GeometryCursor prepared = OGCStructureInternal.prepare_for_ops_(collection.flatten().getEsriGeometryCursor(), esriSR); return removeOverlapsHelper_(toList(prepared)); } }
private GeometryCursor prepare_for_ops_(OGCConcreteGeometryCollection collection) { assert(collection != null && !collection.isEmpty()); GeometryCursor prepared = OGCStructureInternal.prepare_for_ops_(collection.flatten().getEsriGeometryCursor(), esriSR); return removeOverlapsHelper_(toList(prepared)); } }
/** * Fixes topological overlaps in the GeometryCollecion. * This is equivalent to union of the geometry collection elements. * * TODO "flattened" collection is supposed to contain only mutli-geometries, but this method may return single geometries * e.g. for GEOMETRYCOLLECTION (LINESTRING (...)) it returns GEOMETRYCOLLECTION (LINESTRING (...)) * and not GEOMETRYCOLLECTION (MULTILINESTRING (...)) * @return A geometry collection that is flattened and has no overlapping elements. */ public OGCConcreteGeometryCollection flattenAndRemoveOverlaps() { //flatten and crack/cluster GeometryCursor cursor = OGCStructureInternal.prepare_for_ops_(flatten().getEsriGeometryCursor(), esriSR); //make sure geometries don't overlap return new OGCConcreteGeometryCollection(removeOverlapsHelper_(toList(cursor)), esriSR); }
/** * Fixes topological overlaps in the GeometryCollecion. * This is equivalent to union of the geometry collection elements. * * TODO "flattened" collection is supposed to contain only mutli-geometries, but this method may return single geometries * e.g. for GEOMETRYCOLLECTION (LINESTRING (...)) it returns GEOMETRYCOLLECTION (LINESTRING (...)) * and not GEOMETRYCOLLECTION (MULTILINESTRING (...)) * @return A geometry collection that is flattened and has no overlapping elements. */ public OGCConcreteGeometryCollection flattenAndRemoveOverlaps() { //flatten and crack/cluster GeometryCursor cursor = OGCStructureInternal.prepare_for_ops_(flatten().getEsriGeometryCursor(), esriSR); //make sure geometries don't overlap return new OGCConcreteGeometryCollection(removeOverlapsHelper_(toList(cursor)), esriSR); }
@Override public OGCGeometry envelope() { GeometryCursor gc = getEsriGeometryCursor(); Envelope env = new Envelope(); for (Geometry g = gc.next(); g != null; g = gc.next()) { Envelope e = new Envelope(); g.queryEnvelope(e); env.merge(e); } Polygon polygon = new Polygon(); polygon.addEnvelope(env, false); return new OGCPolygon(polygon, esriSR); }
@Override public OGCGeometry envelope() { GeometryCursor gc = getEsriGeometryCursor(); Envelope env = new Envelope(); for (Geometry g = gc.next(); g != null; g = gc.next()) { Envelope e = new Envelope(); g.queryEnvelope(e); env.merge(e); } Polygon polygon = new Polygon(); polygon.addEnvelope(env, false); return new OGCPolygon(polygon, esriSR); }
ArrayList<Geometry> polygons = null; OGCMultiLineString polyline = null; GeometryCursor gc = getEsriGeometryCursor(); for (Geometry g = gc.next(); g != null; g = gc.next()) { if (g.isEmpty())
ArrayList<Geometry> polygons = null; OGCMultiLineString polyline = null; GeometryCursor gc = getEsriGeometryCursor(); for (Geometry g = gc.next(); g != null; g = gc.next()) { if (g.isEmpty())
@Override public OGCGeometry convexHull() { GeometryCursor cursor = OperatorConvexHull.local().execute( getEsriGeometryCursor(), false, null); MultiPoint mp = new MultiPoint(); Polygon polygon = new Polygon();
@Override public OGCGeometry convexHull() { GeometryCursor cursor = OperatorConvexHull.local().execute( getEsriGeometryCursor(), false, null); MultiPoint mp = new MultiPoint(); Polygon polygon = new Polygon();