@SqlNullable @Description("Returns TRUE if the LineString or Multi-LineString's start and end points are coincident") @ScalarFunction("ST_IsClosed") @SqlType(BOOLEAN) public static Boolean stIsClosed(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_IsClosed", geometry, EnumSet.of(LINE_STRING, MULTI_LINE_STRING)); MultiPath lines = (MultiPath) geometry.getEsriGeometry(); int pathCount = lines.getPathCount(); for (int i = 0; i < pathCount; i++) { Point start = lines.getPoint(lines.getPathStart(i)); Point end = lines.getPoint(lines.getPathEnd(i) - 1); if (!end.equals(start)) { return false; } } return true; }
public int numGeometries() { MultiPath mp = (MultiPath) getEsriGeometry(); return mp.getPathCount(); }
public int numGeometries() { MultiPath mp = (MultiPath) getEsriGeometry(); return mp.getPathCount(); }
public boolean isClosed() { MultiPath mp = (MultiPath) getEsriGeometry(); for (int i = 0, n = mp.getPathCount(); i < n; i++) { if (!mp.isClosedPathInXYPlane(i)) return false; } return true; }
public boolean isClosed() { MultiPath mp = (MultiPath) getEsriGeometry(); for (int i = 0, n = mp.getPathCount(); i < n; i++) { if (!mp.isClosedPathInXYPlane(i)) return false; } return true; }
@Override public Geometry next() { if (m_geometry == null) { m_index = 0; m_geometry = m_geoms.next(); if (m_geometry == null) return null; } MultiPath mp = (MultiPath) (m_geometry); if (m_index < mp.getPathCount()) { int ind = m_index; m_index++; return m_bufferer.bufferPolylinePath_((Polyline) m_geometry, ind, m_bfilter); } m_geometry = null; return next(); }
@Override public Geometry next() { if (m_geometry == null) { m_index = 0; m_geometry = m_geoms.next(); if (m_geometry == null) return null; } MultiPath mp = (MultiPath) (m_geometry); if (m_index < mp.getPathCount()) { int ind = m_index; m_index++; return m_bufferer.bufferPolylinePath_((Polyline) m_geometry, ind, m_bfilter); } m_geometry = null; return next(); }
private static boolean multiPathExactlyEqualsMultiPath_( MultiPath multipathA, MultiPath multipathB, double tolerance, ProgressTracker progress_tracker) { if (multipathA.getPathCount() != multipathB.getPathCount() || multipathA.getPointCount() != multipathB.getPointCount()) return false; Point2D ptA = new Point2D(), ptB = new Point2D(); boolean bAllPointsEqual = true; double tolerance_sq = tolerance * tolerance; for (int ipath = 0; ipath < multipathA.getPathCount(); ipath++) { if (multipathA.getPathEnd(ipath) != multipathB.getPathEnd(ipath)) { bAllPointsEqual = false; break; } for (int i = multipathA.getPathStart(ipath); i < multipathB .getPathEnd(ipath); i++) { multipathA.getXY(i, ptA); multipathB.getXY(i, ptB); if (Point2D.sqrDistance(ptA, ptB) > tolerance_sq) { bAllPointsEqual = false; break; } } if (!bAllPointsEqual) break; } if (!bAllPointsEqual) return false; return true; }
private static boolean multiPathExactlyEqualsMultiPath_( MultiPath multipathA, MultiPath multipathB, double tolerance, ProgressTracker progress_tracker) { if (multipathA.getPathCount() != multipathB.getPathCount() || multipathA.getPointCount() != multipathB.getPointCount()) return false; Point2D ptA = new Point2D(), ptB = new Point2D(); boolean bAllPointsEqual = true; double tolerance_sq = tolerance * tolerance; for (int ipath = 0; ipath < multipathA.getPathCount(); ipath++) { if (multipathA.getPathEnd(ipath) != multipathB.getPathEnd(ipath)) { bAllPointsEqual = false; break; } for (int i = multipathA.getPathStart(ipath); i < multipathB .getPathEnd(ipath); i++) { multipathA.getXY(i, ptA); multipathB.getXY(i, ptB); if (Point2D.sqrDistance(ptA, ptB) > tolerance_sq) { bAllPointsEqual = false; break; } } if (!bAllPointsEqual) break; } if (!bAllPointsEqual) return false; return true; }
@SqlNullable @Description("Returns TRUE if the LineString or Multi-LineString's start and end points are coincident") @ScalarFunction("ST_IsClosed") @SqlType(BOOLEAN) public static Boolean stIsClosed(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_IsClosed", geometry, EnumSet.of(LINE_STRING, MULTI_LINE_STRING)); MultiPath lines = (MultiPath) geometry.getEsriGeometry(); int pathCount = lines.getPathCount(); for (int i = 0; i < pathCount; i++) { Point start = lines.getPoint(lines.getPathStart(i)); Point end = lines.getPoint(lines.getPathEnd(i) - 1); if (!end.equals(start)) { return false; } } return true; }
@SqlNullable @Description("Returns TRUE if the LineString or Multi-LineString's start and end points are coincident") @ScalarFunction("ST_IsClosed") @SqlType(BOOLEAN) public static Boolean stIsClosed(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_IsClosed", geometry, EnumSet.of(LINE_STRING, MULTI_LINE_STRING)); MultiPath lines = (MultiPath) geometry.getEsriGeometry(); int pathCount = lines.getPathCount(); for (int i = 0; i < pathCount; i++) { Point start = lines.getPoint(lines.getPathStart(i)); Point end = lines.getPoint(lines.getPathEnd(i) - 1); if (!end.equals(start)) { return false; } } return true; }
private Geometry Generalize(Geometry geom) { Geometry.Type gt = geom.getType(); if (Geometry.isPoint(gt.value())) return geom; if (gt == Geometry.Type.Envelope) { Polygon poly = new Polygon(geom.getDescription()); poly.addEnvelope((Envelope) geom, false); return Generalize(poly); } if (geom.isEmpty()) return geom; MultiPath mp = (MultiPath) geom; MultiPath dstmp = (MultiPath) geom.createInstance(); Line line = new Line(); for (int ipath = 0, npath = mp.getPathCount(); ipath < npath; ipath++) { GeneralizePath((MultiPathImpl) mp._getImpl(), ipath, (MultiPathImpl) dstmp._getImpl(), line); } return dstmp; }
private Geometry Generalize(Geometry geom) { Geometry.Type gt = geom.getType(); if (Geometry.isPoint(gt.value())) return geom; if (gt == Geometry.Type.Envelope) { Polygon poly = new Polygon(geom.getDescription()); poly.addEnvelope((Envelope) geom, false); return Generalize(poly); } if (geom.isEmpty()) return geom; MultiPath mp = (MultiPath) geom; MultiPath dstmp = (MultiPath) geom.createInstance(); Line line = new Line(); for (int ipath = 0, npath = mp.getPathCount(); ipath < npath; ipath++) { GeneralizePath((MultiPathImpl) mp._getImpl(), ipath, (MultiPathImpl) dstmp._getImpl(), line); } return dstmp; }
case ST_MULTILINESTRING: MultiPath lines = (MultiPath)(ogcGeometry.getEsriGeometry()); int nPaths = lines.getPathCount(); boolean rslt = true; for (int ix = 0; rslt && ix < nPaths; ix++) {
default: MultiPath lines = (MultiPath)(esriGeom); int nPath = lines.getPathCount(); double length = 0.; for (int ix = 0; ix < nPath; ix++) {
int n = pp.getPathCount(); // rings or paths
int n = pp.getPathCount(); // rings or paths
for (int ipath = 0, npath = multi_path_b.getPathCount(); ipath < npath; ipath++) if (PointInPolygonHelper.quadTreeWillHelp(polygon_a, multi_path_b.getPathCount() - 1) && (polygon_impl_a._getAccelerators() == null || polygon_impl_a._getAccelerators().getQuadTree() == null)) { pa = new Polygon(); polygon_a.copyTo(pa);
if (PointInPolygonHelper.quadTreeWillHelp(polygon_a, multipath_b.getPathCount() - 1) && (multi_path_impl_a._getAccelerators() == null || multi_path_impl_a._getAccelerators().getQuadTree() == null)) { pa = new Polygon(); polygon_a.copyTo(pa);
if (PointInPolygonHelper.quadTreeWillHelp(polygon_a, multipath_b.getPathCount() - 1) && (multi_path_impl_a._getAccelerators() == null || multi_path_impl_a._getAccelerators().getQuadTree() == null)) { pa = new Polygon(); polygon_a.copyTo(pa);