@SqlNullable @Description("Returns the last point of a LINESTRING geometry as a Point") @ScalarFunction("ST_EndPoint") @SqlType(GEOMETRY_TYPE_NAME) public static Slice stEndPoint(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_EndPoint", geometry, EnumSet.of(LINE_STRING)); if (geometry.isEmpty()) { return null; } MultiPath lines = (MultiPath) geometry.getEsriGeometry(); SpatialReference reference = geometry.getEsriSpatialReference(); return serialize(createFromEsriGeometry(lines.getPoint(lines.getPointCount() - 1), reference)); }
public int numPoints() { if (multiPath.isEmpty()) return 0; return multiPath.getPointCount() + 1; }
public int numPoints() { if (multiPath.isEmpty()) return 0; return multiPath.getPointCount() + 1; }
/** * The number of Points in this LineString. */ public int numPoints() { if (multiPath.isEmpty()) return 0; int d = multiPath.isClosedPath(0) ? 1 : 0; return multiPath.getPointCount() + d; }
/** * The number of Points in this LineString. */ public int numPoints() { if (multiPath.isEmpty()) return 0; int d = multiPath.isClosedPath(0) ? 1 : 0; return multiPath.getPointCount() + d; }
return; int[] xpoints = new int[path.getPointCount()]; int[] ypoints = new int[path.getPointCount()]; for (int i = 0; i < path.getPointCount(); i++) { double px = path.getPoint(i).getX(); double py = path.getPoint(i).getY(); g.drawPolygon(xpoints, ypoints, path.getPointCount()); else if (path instanceof Polyline) g.drawPolyline(xpoints, ypoints, path.getPointCount());
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 the last point of a LINESTRING geometry as a Point") @ScalarFunction("ST_EndPoint") @SqlType(GEOMETRY_TYPE_NAME) public static Slice stEndPoint(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_EndPoint", geometry, EnumSet.of(LINE_STRING)); if (geometry.isEmpty()) { return null; } MultiPath lines = (MultiPath) geometry.getEsriGeometry(); SpatialReference reference = geometry.getEsriSpatialReference(); return serialize(createFromEsriGeometry(lines.getPoint(lines.getPointCount() - 1), reference)); }
@SqlNullable @Description("Returns the last point of a LINESTRING geometry as a Point") @ScalarFunction("ST_EndPoint") @SqlType(GEOMETRY_TYPE_NAME) public static Slice stEndPoint(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_EndPoint", geometry, EnumSet.of(LINE_STRING)); if (geometry.isEmpty()) { return null; } MultiPath lines = (MultiPath) geometry.getEsriGeometry(); SpatialReference reference = geometry.getEsriSpatialReference(); return serialize(createFromEsriGeometry(lines.getPoint(lines.getPointCount() - 1), reference)); }
pn = lines.getPoint(idx); } catch (Exception e) { LogUtils.Log_InvalidIndex(LOG, idx+1, 1, lines.getPointCount()); return null;
spatialReference = SpatialReference.create(wkid); return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(lines.getPoint(lines.getPointCount()-1), spatialReference)); } else {
break; default: resultInt.set(((MultiPath)(esriGeom)).getPointCount()); break;
if (((MultiPath) geometryA).getPointCount() > ((MultiPath) geometryB) .getPointCount()) return bruteForceMultiPathMultiPath_((MultiPath) geometryA, (MultiPath) geometryB, geometriesAreDisjoint);
if (((MultiPath) geometryA).getPointCount() > ((MultiPath) geometryB) .getPointCount()) return bruteForceMultiPathMultiPath_((MultiPath) geometryA, (MultiPath) geometryB, geometriesAreDisjoint);