/** * 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); }
/** * 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; }
/** * Create a new Geometry operation expression * * @param op operator * @param args arguments * @return operation expression */ public static GeometryExpression<Geometry> geometryOperation(Operator op, Expression<?>... args) { return new GeometryOperation<Geometry>(Geometry.class, op, args); }
@Test public void convert() { GeometryPath<Geometry> geometry = new GeometryPath<Geometry>("geometry"); assertEquals(new GeometryCollectionPath<GeometryCollection>("geometry"), geometry.asCollection()); assertEquals(new LinearRingPath<LinearRing>("geometry"), geometry.asLinearRing()); assertEquals(new LineStringPath<LineString>("geometry"), geometry.asLineString()); assertEquals(new MultiLineStringPath<MultiLineString>("geometry"), geometry.asMultiLineString()); assertEquals(new MultiPointPath<MultiPoint>("geometry"), geometry.asMultiPoint()); assertEquals(new MultiPolygonPath<MultiPolygon>("geometry"), geometry.asMultiPolygon()); assertEquals(new PointPath<Point>("geometry"), geometry.asPoint()); assertEquals(new PolygonPath<Polygon>("geometry"), geometry.asPolygon()); assertEquals(new PolyhedralSurfacePath<PolyHedralSurface>("geometry"), geometry.asPolyHedralSurface()); } }
/** * Create a new Point operation expression * * @param op operator * @param args arguments * @return operation expression */ public static PointExpression<Point> pointOperation(Operator op, Expression<?>... args) { return new PointOperation<Point>(Point.class, op, args); }
/** * Create a new Polygon operation expression * * @param op operator * @param args arguments * @return operation expression */ public static PolygonExpression<Polygon> polygonOperation(Operator op, Expression<?>... args) { return new PolygonOperation<Polygon>(Polygon.class, op, args); }
/** * 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; }
/** * Create a new LineString operation expression * * @param op operator * @param args arguments * @return operation expression */ public static LineStringExpression<LineString> lineStringOperation(Operator op, Expression<?>... args) { return new LineStringOperation<LineString>(LineString.class, op, args); }
/** * 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); }
/** * 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; }
/** * Create a new Geometry operation expression * * @param op operator * @param args arguments * @return operation expression */ public static <T extends Geometry> GeometryExpression<T> geometryOperation(Class<? extends T> type, Operator op, Expression<?>... args) { return new GeometryOperation<T>(type, op, args); }
/** * 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); }
/** * 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 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); }
/** * 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); }
/** * Returns the closure of the combinatorial boundary of this geometric object * * @return boundary */ public GeometryExpression<Geometry> boundary() { if (boundary == null) { boundary = GeometryExpressions.geometryOperation(SpatialOps.BOUNDARY, mixin); } return boundary; }
/** * 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); }
/** * 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); }