/** * Returns a geometric object that represents the Point set intersection of this geometric * object with anotherGeometry. * * @param geometry other geometry * @return intersection of this and the other geometry */ public GeometryExpression<Geometry> intersection(Expression<? extends Geometry> geometry) { return GeometryExpressions.geometryOperation(SpatialOps.INTERSECTION, mixin, geometry); }
/** * Returns the exterior ring of this Polygon. * * @return exterior ring */ public LineStringExpression<?> exteriorRing() { if (exterorRing == null) { exterorRing = GeometryExpressions.lineStringOperation(SpatialOps.EXTERIOR_RING, mixin); } return exterorRing; }
/** * The end Point of this Curve. * * @return end point */ public PointExpression<Point> endPoint() { if (endPoint == null) { endPoint = GeometryExpressions.pointOperation(SpatialOps.END_POINT, mixin); } return endPoint; }
@Test @IncludeIn(Target.POSTGRESQL) public void extensions() { List<Expression<?>> expressions = Lists.newArrayList(); GeometryExpression<?> expr1 = shapes.geometry; expressions.add(GeometryExpressions.asEWKT(expr1)); expressions.add(GeometryExpressions.fromText(expr1.asText())); expressions.add(GeometryExpressions.setSRID(expr1, 4326)); expressions.add(GeometryExpressions.xmin(expr1)); expressions.add(GeometryExpressions.xmax(expr1)); expressions.add(GeometryExpressions.ymin(expr1)); expressions.add(GeometryExpressions.ymax(expr1)); expressions.add(GeometryExpressions.dwithin(expr1, expr1, 1)); expressions.add(GeometryExpressions.collect(expr1, expr1)); expressions.add(GeometryExpressions.translate(expr1, 1, 1)); for (Expression<?> expr : expressions) { boolean logged = false; for (Object row : withPoints().select(expr).fetch()) { if (row == null && !logged) { System.err.println(expr.toString()); logged = true; } } } }
/** * Returns a polygon in this surface, the order is arbitrary. * * @param n one based index * @return polygon at index */ public PolygonExpression<?> patchN(int n) { return GeometryExpressions.polygonOperation(SpatialOps.SURFACE, mixin, ConstantImpl.create(n)); }
/** * Create a new GeometryExpression * * @param value Geometry * @return new GeometryExpression */ public static <T extends Geometry> GeometryExpression<T> asGeometry(T value) { return asGeometry(Expressions.constant(value)); }
/** * Returns the bounding box that bounds rows of geometries. * * @param collection geometry collection * @return bounding box */ public static GeometryExpression<?> extent(Expression<? extends GeometryCollection> collection) { return geometryOperation(SpatialOps.EXTENT, collection); }
/** * A Point guaranteed to be on this Surface. * * @return point on surface */ public PointExpression<Point> pointOnSurface() { if (pointOnSurface == null) { pointOnSurface = GeometryExpressions.pointOperation(SpatialOps.POINT_ON_SURFACE, mixin); } return pointOnSurface; }
/** * Returns the N th interior ring for this Polygon as a LineString. * * @param idx one based index * @return interior ring at index */ public LineStringExpression<LineString> interiorRingN(int idx) { return GeometryExpressions.lineStringOperation(SpatialOps.INTERIOR_RINGN, mixin, ConstantImpl.create(idx)); } }
/** * Returns a geometric object that represents the * Point set symmetric difference of this geometric object with anotherGeometry. * * @param geometry other geometry * @return symmetric difference between this and the geometry */ public GeometryExpression<Geometry> symDifference(Expression<? extends Geometry> geometry) { return GeometryExpressions.geometryOperation(SpatialOps.SYMDIFFERENCE, mixin, geometry); }
/** * The mathematical centroid for this MultiSurface. The result is not guaranteed to be on * this MultiSurface. * * @return centroid */ public PointExpression<Point> centroid() { if (centroid == null) { centroid = GeometryExpressions.pointOperation(SpatialOps.CENTROID, mixin); } return centroid; }
/** * Return a specified ST_Geometry value from Well-Known Text representation (WKT). * * @param text WKT form * @return geometry */ public static GeometryExpression<?> fromText(Expression<String> text) { return geometryOperation(SpatialOps.GEOM_FROM_TEXT, text); }
/** * A Point guaranteed to be on this MultiSurface. * * @return point on surface */ public PointExpression<Point> pointOnSurface() { if (pointOnSurface == null) { pointOnSurface = GeometryExpressions.pointOperation(SpatialOps.POINT_ON_SURFACE, mixin); } return pointOnSurface; }
/** * Return a specified ST_Geometry value from a collection of other geometries. * * @param expr1 geometry * @param expr2 other geometry * @return geometry collection */ public static GeometryExpression<?> collect(Expression<? extends Geometry> expr1, Expression<? extends Geometry> expr2) { return geometryOperation(SpatialOps.COLLECT2, expr1, expr2); }
/** * The mathematical centroid for this Surface as a Point. The result is not guaranteed to * be on this Surface. * * @return centroid */ public PointExpression<Point> centroid() { if (centroid == null) { centroid = GeometryExpressions.pointOperation(SpatialOps.CENTROID, mixin); } return centroid; }
/** * Returns a geometric object that represents the Point set * union of this geometric object with anotherGeometry. * * @param geometry other geometry * @return union of this and the other geometry */ public GeometryExpression<Geometry> union(Expression<? extends Geometry> geometry) { return GeometryExpressions.geometryOperation(SpatialOps.UNION, mixin, geometry); }
/** * The start Point of this Curve. * * @return start point */ public PointExpression<Point> startPoint() { if (startPoint == null) { startPoint = GeometryExpressions.pointOperation(SpatialOps.START_POINT, mixin); } return startPoint; }
/** * Returns a geometric object that represents the Point * set difference of this geometric object with anotherGeometry. * * @param geometry other geometry * @return difference between this and the other geometry */ public GeometryExpression<Geometry> difference(Expression<? extends Geometry> geometry) { return GeometryExpressions.geometryOperation(SpatialOps.DIFFERENCE, mixin, geometry); }
/** * Returns the specified Point N in this LineString. * * @param idx one-based index of element * @return matched element */ public PointExpression<Point> pointN(int idx) { return GeometryExpressions.pointOperation(SpatialOps.POINTN, mixin, ConstantImpl.create(idx)); }
/** * Return a specified ST_Geometry value from a collection of other geometries. * * @param collection geometry collection * @return geometry collection */ public static GeometryExpression<?> collect(Expression<? extends GeometryCollection> collection) { return geometryOperation(SpatialOps.COLLECT, collection); }