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_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_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)); }
public static GeometryType pointN(GeometryType geom, int i) throws FunctionExecutionException { Geometry g = getGeometry(geom); if (!(g instanceof LineString)) { return null; } LineString g2 = (LineString)g; if (i < 0 || i >= g2.getNumPoints()) { return null; } return getGeometryType(g2.getPointN(i)); }
public static GeometryType symDifference(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { Geometry g1 = getGeometry(geom1); Geometry g2 = getGeometry(geom2); return getGeometryType(g1.symDifference(g2)); }
public static GeometryType pointOnSurface(GeometryType geom) throws FunctionExecutionException { Geometry g = getGeometry(geom); Point point = g.getInteriorPoint(); if (point == null) { return null; } return getGeometryType(point, geom.getSrid()); }
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 GeometryType exteriorRing(GeometryType geom) throws FunctionExecutionException { Geometry g = getGeometry(geom); if (!(g instanceof Polygon)) { return null; } return getGeometryType(((Polygon)g).getExteriorRing(), geom.getSrid()); }
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); } }
public static GeometryType union(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { Geometry g1 = getGeometry(geom1); Geometry g2 = getGeometry(geom2); return getGeometryType(g1.union(g2)); }
public static GeometryType pointN(GeometryType geom, int i) throws FunctionExecutionException { Geometry g = getGeometry(geom); if (!(g instanceof LineString)) { return null; } LineString g2 = (LineString)g; if (i < 0 || i >= g2.getNumPoints()) { return null; } return getGeometryType(g2.getPointN(i), geom.getSrid()); }
public static GeometryType intersection(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { Geometry g1 = getGeometry(geom1); Geometry g2 = getGeometry(geom2); return getGeometryType(g1.intersection(g2), geom1.getSrid()); }
public static GeometryType pointN(GeometryType geom, int i) throws FunctionExecutionException { Geometry g = getGeometry(geom); if (!(g instanceof LineString)) { return null; } LineString g2 = (LineString)g; if (i < 0 || i >= g2.getNumPoints()) { return null; } return getGeometryType(g2.getPointN(i), geom.getSrid()); }
public static GeometryType union(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { Geometry g1 = getGeometry(geom1); Geometry g2 = getGeometry(geom2); return getGeometryType(g1.union(g2), geom1.getSrid()); }
public static GeometryType intersection(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { Geometry g1 = getGeometry(geom1); Geometry g2 = getGeometry(geom2); return getGeometryType(g1.intersection(g2), geom1.getSrid()); }
public static GeometryType interiorRingN(GeometryType geom, int i) throws FunctionExecutionException { Geometry g = getGeometry(geom); if (!(g instanceof Polygon)) { return null; } Polygon g2 = (Polygon)g; if (i < 0 || i >= g2.getNumInteriorRing()) { return null; } return getGeometryType(g2.getInteriorRingN(i), geom.getSrid()); }
public static GeometryType pointOnSurface(GeometryType geom) throws FunctionExecutionException { Geometry g = getGeometry(geom); Point point = g.getInteriorPoint(); if (point == null) { return null; } point.setSRID(geom.getSrid()); return getGeometryType(point); }
public static GeometryType symDifference(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { Geometry g1 = getGeometry(geom1); Geometry g2 = getGeometry(geom2); return getGeometryType(g1.symDifference(g2), geom1.getSrid()); }
public static GeometryType simplify( GeometryType geom, double tolerance) throws FunctionExecutionException { DouglasPeuckerSimplifier douglasPeuckerSimplifier = new DouglasPeuckerSimplifier(getGeometry(geom)); douglasPeuckerSimplifier.setEnsureValid(false); douglasPeuckerSimplifier.setDistanceTolerance(tolerance); Geometry resultGeometry = douglasPeuckerSimplifier.getResultGeometry(); return getGeometryType(resultGeometry); }
public static GeometryType simplify( GeometryType geom, double tolerance) throws FunctionExecutionException { DouglasPeuckerSimplifier douglasPeuckerSimplifier = new DouglasPeuckerSimplifier(getGeometry(geom)); douglasPeuckerSimplifier.setEnsureValid(false); douglasPeuckerSimplifier.setDistanceTolerance(tolerance); Geometry resultGeometry = douglasPeuckerSimplifier.getResultGeometry(); return getGeometryType(resultGeometry, geom.getSrid()); }