@Description("Returns the length of a LineString or Multi-LineString using Euclidean measurement on a 2D plane (based on spatial ref) in projected units") @ScalarFunction("ST_Length") @SqlType(DOUBLE) public static double stLength(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Length", geometry, EnumSet.of(LINE_STRING, MULTI_LINE_STRING)); return geometry.getEsriGeometry().calculateLength2D(); }
public double length() { return getEsriGeometry().calculateLength2D(); } }
public double length() { return getEsriGeometry().calculateLength2D(); } }
@Override protected Object evaluateOGCGeometry(OGCGeometry geometry) throws HyracksDataException { if (geometry instanceof OGCLineString) { return geometry.getEsriGeometry().calculateLength2D(); } else if (geometry instanceof OGCMultiLineString) { GeometryCursor cursor = geometry.getEsriGeometryCursor(); double length = 0; Geometry geometry1 = cursor.next(); while (geometry1 != null) { length += geometry1.calculateLength2D(); geometry1 = cursor.next(); } return length; } else { throw new UnsupportedOperationException( "The operation " + getIdentifier() + " is not supported for the type " + geometry.geometryType()); } }
@Description("Returns the length of a LineString or Multi-LineString using Euclidean measurement on a 2D plane (based on spatial ref) in projected units") @ScalarFunction("ST_Length") @SqlType(DOUBLE) public static double stLength(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Length", geometry, EnumSet.of(LINE_STRING, MULTI_LINE_STRING)); return geometry.getEsriGeometry().calculateLength2D(); }
@Description("Returns the length of a LineString or Multi-LineString using Euclidean measurement on a 2D plane (based on spatial ref) in projected units") @ScalarFunction("ST_Length") @SqlType(DOUBLE) public static double stLength(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Length", geometry, EnumSet.of(LINE_STRING, MULTI_LINE_STRING)); return geometry.getEsriGeometry().calculateLength2D(); }
public DoubleWritable evaluate(BytesWritable geomref) { if (geomref == null || geomref.getLength() == 0) { LogUtils.Log_ArgumentsNull(LOG); return null; } OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref); if (ogcGeometry == null){ LogUtils.Log_ArgumentsNull(LOG); return null; } resultDouble.set(ogcGeometry.getEsriGeometry().calculateLength2D()); return resultDouble; } }