public static GeometryType geometryFromGml(ClobType gml, Integer srid) throws FunctionExecutionException { try { Geometry geom = geometryFromGml(gml.getCharacterStream(), srid); return getGeometryType(geom); } catch (SQLException e) { throw new FunctionExecutionException(e); } }
@TeiidFunction(name=SourceSystemFunctions.ST_ASEWKB, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static BlobType asEwkb(final GeometryType geometry) { return GeometryUtils.geometryToEwkb(geometry); }
@TeiidFunction(name=SourceSystemFunctions.ST_ASGEOJSON, category=FunctionCategoryConstants.GEOMETRY, pushdown=PushDown.CAN_PUSHDOWN, nullOnNull=true) public static ClobType asGeoJson(GeometryType geometry) throws FunctionExecutionException { return GeometryUtils.geometryToGeoJson(geometry); }
public static GeometryType geometryFromEwkb(InputStream is, Integer srid) throws FunctionExecutionException { Geometry geom = getGeometry(is, srid, true); return getGeometryType(geom); }
@TeiidFunction(name=SourceSystemFunctions.ST_GEOMFROMEWKT, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType geomFromEwkt(ClobType ewkt) throws FunctionExecutionException { return GeometryUtils.getGeometryType(GeometryUtils.geometryFromClob(ewkt, null, true)); }
public static Double distance(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { Geometry g1 = getGeometry(geom1); Geometry g2 = getGeometry(geom2); return g1.distance(g2); }
if (is != null) { if (desiredType == GeographyType.class) { return GeometryUtils.geographyFromEwkb(context, is); return GeometryUtils.geometryFromEwkb(is, gis.getSrid()); if (r != null) { if (desiredType == GeographyType.class) { return GeometryUtils.getGeographyType(GeometryUtils.geometryFromGml(r, gis.getSrid())); return GeometryUtils.geometryFromGml(r, gis.getSrid());
@TeiidFunction(name=SourceSystemFunctions.ST_GEOMFROMGML, category=FunctionCategoryConstants.GEOMETRY, pushdown=PushDown.CAN_PUSHDOWN, nullOnNull=true) public static GeometryType geomFromGml(ClobType gml, int srid) throws FunctionExecutionException { return GeometryUtils.geometryFromGml(gml, srid); }
InputStream is = gis.getEwkb(); if (is != null) { return GeometryUtils.geometryFromEwkb(is, gis.getSrid()); Reader r = gis.getGml(); if (r != null) { return GeometryUtils.geometryFromGml(r, gis.getSrid());
public static GeometryType makeEnvelope(double xmin, double ymin, double xmax, double ymax, Integer srid) { Geometry geom = GEOMETRY_FACTORY.createPolygon(new Coordinate[] {new Coordinate(xmin, ymin), new Coordinate(xmin, ymax), new Coordinate(xmax, ymax), new Coordinate(xmax, ymin), new Coordinate(xmin, ymin)}); if (srid != null) { geom.setSRID(srid); } return getGeometryType(geom); }
@TeiidFunction(name=SourceSystemFunctions.ST_AREA, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static Double area(GeometryType geom) throws FunctionExecutionException { return GeometryUtils.area(geom); }
@TeiidFunction(name=SourceSystemFunctions.ST_BOUNDARY, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType boundary(GeometryType geom) throws FunctionExecutionException { return GeometryUtils.boundary(geom); }
@TeiidFunction(name=SourceSystemFunctions.ST_CENTROID, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType centroid(GeometryType geom) throws FunctionExecutionException { return GeometryUtils.centroid(geom); }
@TeiidFunction(name=SQLConstants.Tokens.DOUBLE_AMP, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static boolean boundingBoxIntersects(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { return GeometryUtils.boundingBoxIntersects(geom1, geom2); }
@TeiidFunction(name=SourceSystemFunctions.ST_BUFFER, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType buffer(GeometryType geom, double distance) throws FunctionExecutionException { return GeometryUtils.buffer(geom, distance); }
public static GeometryType difference(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { Geometry g1 = getGeometry(geom1); Geometry g2 = getGeometry(geom2); return getGeometryType(g1.difference(g2)); }
public static Boolean intersects(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { Geometry g1 = getGeometry(geom1); Geometry g2 = getGeometry(geom2); return g1.intersects(g2); }
if (is != null) { if (desiredType == GeographyType.class) { return GeometryUtils.geographyFromEwkb(context, is); return GeometryUtils.geometryFromEwkb(is, gis.getSrid()); if (r != null) { if (desiredType == GeographyType.class) { return GeometryUtils.getGeographyType(GeometryUtils.geometryFromGml(r, gis.getSrid())); return GeometryUtils.geometryFromGml(r, gis.getSrid());
@TeiidFunction(name=SourceSystemFunctions.ST_GEOMFROMTEXT, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType geomFromText(ClobType wkt, int srid) throws FunctionExecutionException { return GeometryUtils.getGeometryType(GeometryUtils.geometryFromClob(wkt, srid, false)); }
@TeiidFunction(name=SourceSystemFunctions.ST_GEOMFROMGML, category=FunctionCategoryConstants.GEOMETRY, pushdown=PushDown.CAN_PUSHDOWN, nullOnNull=true) public static GeometryType geomFromGml(ClobType gml, int srid) throws FunctionExecutionException { return GeometryUtils.geometryFromGml(gml, srid); }