@Description("Returns the closure of the combinatorial boundary of this Geometry") @ScalarFunction("ST_Boundary") @SqlType(GEOMETRY_TYPE_NAME) public static Slice stBoundary(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); if (geometry.isEmpty() && GeometryType.getForEsriGeometryType(geometry.geometryType()) == LINE_STRING) { // OCGGeometry#boundary crashes with NPE for LINESTRING EMPTY return EMPTY_MULTIPOINT; } return serialize(geometry.boundary()); }
@Override protected Object evaluateOGCGeometry(OGCGeometry geometry) throws HyracksDataException { return geometry.boundary(); }
public BytesWritable 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; } try { OGCGeometry boundGeom = ogcGeometry.boundary(); if (boundGeom.geometryType().equals("MultiLineString") && ((OGCMultiLineString)boundGeom).numGeometries() == 1) boundGeom = ((OGCMultiLineString)boundGeom).geometryN(0); // match ST_Boundary/SQL-RDBMS return GeometryUtils.geometryToEsriShapeBytesWritable(boundGeom); } catch (Exception e) { LogUtils.Log_InternalError(LOG, "ST_Boundary: " + e); return null; } }
@Description("Returns the closure of the combinatorial boundary of this Geometry") @ScalarFunction("ST_Boundary") @SqlType(GEOMETRY_TYPE_NAME) public static Slice stBoundary(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); if (geometry.isEmpty() && GeometryType.getForEsriGeometryType(geometry.geometryType()) == LINE_STRING) { // OCGGeometry#boundary crashes with NPE for LINESTRING EMPTY return EMPTY_MULTIPOINT; } return serialize(geometry.boundary()); }
@Description("Returns the closure of the combinatorial boundary of this Geometry") @ScalarFunction("ST_Boundary") @SqlType(GEOMETRY_TYPE_NAME) public static Slice stBoundary(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); if (geometry.isEmpty() && GeometryType.getForEsriGeometryType(geometry.geometryType()) == LINE_STRING) { // OCGGeometry#boundary crashes with NPE for LINESTRING EMPTY return EMPTY_MULTIPOINT; } return serialize(geometry.boundary()); }