/** * Translates the geometry to a new location using the numeric parameters as offsets. * * @param expr geometry * @param deltax x offset * @param deltay y offset * @param <T> * @return geometry */ public static <T extends Geometry> JTSGeometryExpression<T> translate( Expression<T> expr, float deltax, float deltay) { return geometryOperation( expr.getType(), SpatialOps.TRANSLATE, expr, ConstantImpl.create(deltax), ConstantImpl.create(deltay)); }
/** * Sets the SRID on a geometry to a particular integer value. * * @param expr geometry * @param srid SRID * @param <T> * @return geometry */ public static <T extends Geometry> JTSGeometryExpression<T> setSRID( Expression<T> expr, int srid) { return geometryOperation(expr.getType(), SpatialOps.SET_SRID, expr, ConstantImpl.create(srid)); }
/** * Return a specified ST_Geometry value from Well-Known Text representation (WKT). * * @param text WKT form * @return geometry */ public static JTSGeometryExpression<?> fromText(String text) { return geometryOperation(SpatialOps.GEOM_FROM_TEXT, ConstantImpl.create(text)); }
/** * Returns true if the geometries are within the specified distance of one another. For geometry * units are in those of spatial reference and For geography units are in meters. * * @param expr1 geometry * @param expr2 other geometry * @param distance distance * @return true, if with distance of each other */ public static BooleanExpression dwithin( Expression<? extends Geometry> expr1, Expression<? extends Geometry> expr2, double distance) { return Expressions.booleanOperation( SpatialOps.DWITHIN, expr1, expr2, ConstantImpl.create(distance)); }
/** * Returns the specified Point N in this LineString. * * @param idx one basedindex of element * @return matched element */ public PointExpression<Point> pointN(int idx) { return GeometryExpressions.pointOperation(SpatialOps.POINTN, mixin, ConstantImpl.create(idx)); }