@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 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 the first point of a LINESTRING geometry as a Point") @ScalarFunction("ST_StartPoint") @SqlType(GEOMETRY_TYPE_NAME) public static Slice stStartPoint(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_StartPoint", geometry, EnumSet.of(LINE_STRING)); if (geometry.isEmpty()) { return null; } MultiPath lines = (MultiPath) geometry.getEsriGeometry(); SpatialReference reference = geometry.getEsriSpatialReference(); return serialize(createFromEsriGeometry(lines.getPoint(0), 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)); }
@Override public OGCPoint pointN(int n) { int nn; if (n == multiPath.getPathSize(0)) { nn = multiPath.getPathStart(0); } else nn = multiPath.getPathStart(0) + n; return (OGCPoint) OGCGeometry.createFromEsriGeometry( multiPath.getPoint(nn), esriSR); } }
@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)); }
@Override public OGCPoint pointN(int n) { int nn; if (n == multiPath.getPathSize(0)) { nn = multiPath.getPathStart(0); } else nn = multiPath.getPathStart(0) + n; return (OGCPoint) OGCGeometry.createFromEsriGeometry( multiPath.getPoint(nn), esriSR); } }
spatialReference = SpatialReference.create(wkid); return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(lines.getPoint(lines.getPointCount()-1), spatialReference)); } else {
/** * Returns the specified Point N in this LineString. * @param n The 0 based index of the Point. */ public OGCPoint pointN(int n) { int nn; if (multiPath.isClosedPath(0) && n == multiPath.getPathSize(0)) { nn = multiPath.getPathStart(0); } else nn = n + multiPath.getPathStart(0); return (OGCPoint) OGCGeometry.createFromEsriGeometry( multiPath.getPoint(nn), esriSR); }
MultiPath lines = (MultiPath)(esriGeom); try { pn = lines.getPoint(idx); } catch (Exception e) { LogUtils.Log_InvalidIndex(LOG, idx+1, 1, lines.getPointCount());
/** * Returns the specified Point N in this LineString. * @param n The 0 based index of the Point. */ public OGCPoint pointN(int n) { int nn; if (multiPath.isClosedPath(0) && n == multiPath.getPathSize(0)) { nn = multiPath.getPathStart(0); } else nn = n + multiPath.getPathStart(0); return (OGCPoint) OGCGeometry.createFromEsriGeometry( multiPath.getPoint(nn), esriSR); }
@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; }
@SqlNullable @Description("Returns the first point of a LINESTRING geometry as a Point") @ScalarFunction("ST_StartPoint") @SqlType(GEOMETRY_TYPE_NAME) public static Slice stStartPoint(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_StartPoint", geometry, EnumSet.of(LINE_STRING)); if (geometry.isEmpty()) { return null; } MultiPath lines = (MultiPath) geometry.getEsriGeometry(); SpatialReference reference = geometry.getEsriSpatialReference(); return serialize(createFromEsriGeometry(lines.getPoint(0), reference)); }
@SqlNullable @Description("Returns the first point of a LINESTRING geometry as a Point") @ScalarFunction("ST_StartPoint") @SqlType(GEOMETRY_TYPE_NAME) public static Slice stStartPoint(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_StartPoint", geometry, EnumSet.of(LINE_STRING)); if (geometry.isEmpty()) { return null; } MultiPath lines = (MultiPath) geometry.getEsriGeometry(); SpatialReference reference = geometry.getEsriSpatialReference(); return serialize(createFromEsriGeometry(lines.getPoint(0), reference)); }
spatialReference = SpatialReference.create(wkid); return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(lines.getPoint(0), spatialReference)); } else {