Class PointWrapper
java.lang.Object
org.apache.sis.internal.feature.AbstractGeometry
org.apache.sis.internal.feature.GeometryWrapper<G>
org.apache.sis.internal.feature.GeometryWithCRS<Shape>
org.apache.sis.internal.feature.j2d.PointWrapper
- All Implemented Interfaces:
org.opengis.geometry.Geometry
The wrapper of Java2D points. Has to be provided in a separated class because
Point2D are not Shape in Java2D API.- Since:
- 1.1
- Version:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Point2DThe wrapped implementation.private static final BiPredicate<PointWrapper,Object>[] All predicates recognized bypredicateSameCRS(SpatialOperatorName, GeometryWrapper). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanEstimates whether the wrapped geometry is equal to the geometry of the given wrapper.factory()Returns the implementation-dependent factory of geometric object.formatWKT(double flatness) Builds a WKT representation of the wrapped point.double[]Returns all coordinate tuples in the wrapped geometry.org.opengis.geometry.DirectPositionReturns the centroid of the wrapped geometry as a direct position.Returns an empty envelope centered on this point.double[]Returns the point coordinates.Returns the point specified at construction time.private booleanEstimates whether the wrapped geometry intersects the geometry of the given wrapper.protected ShapemergePolylines(Iterator<?> polylines) Merges a sequence of points or paths after this geometry.protected ObjectoperationSameCRS(SQLMM operation, GeometryWrapper<Shape> other, Object argument) Applies a SQLMM operation on this geometry.protected booleanpredicateSameCRS(SpatialOperatorName type, GeometryWrapper<Shape> other) Applies a filter predicate between this geometry and another geometry.private booleanEstimates whether the wrapped geometry is contained by the geometry of the given wrapper.Methods inherited from class org.apache.sis.internal.feature.GeometryWithCRS
createEnvelope, getCoordinateReferenceSystem, isSameCRS, setCoordinateReferenceSystemMethods inherited from class org.apache.sis.internal.feature.GeometryWrapper
equals, getSRID, hashCode, operation, operation, operationWithArgument, operationWithArgument, predicate, predicate, predicateSameCRS, toGeometryType, toString, transform, transform
-
Field Details
-
point
The wrapped implementation. -
PREDICATES
All predicates recognized bypredicateSameCRS(SpatialOperatorName, GeometryWrapper). Array indices areEnum.ordinal()values.
-
-
Constructor Details
-
PointWrapper
PointWrapper(Point2D point) Creates a new wrapper around the given point.
-
-
Method Details
-
factory
Returns the implementation-dependent factory of geometric object.- Specified by:
factoryin classGeometryWrapper<Shape>- Returns:
- the factory of implementation-dependent geometric objects (never
null).
-
implementation
Returns the point specified at construction time.- Specified by:
implementationin classGeometryWrapper<Shape>- Returns:
- the geometry implementation wrapped by this instance (never
null).
-
getEnvelope
Returns an empty envelope centered on this point.- Specified by:
getEnvelopein classGeometryWrapper<Shape>- Returns:
- the geometry envelope. Should never be
null. Note though that for an empty geometry or a single point, the returned envelope will be empty.
-
getCentroid
public org.opengis.geometry.DirectPosition getCentroid()Returns the centroid of the wrapped geometry as a direct position.- Specified by:
getCentroidin classGeometryWrapper<Shape>- Returns:
- the centroid of the wrapped geometry.
-
getPointCoordinates
public double[] getPointCoordinates()Returns the point coordinates.- Specified by:
getPointCoordinatesin classGeometryWrapper<Shape>- Returns:
- the coordinate of the point as an array of length 2 or 3,
or
nullif the geometry is not a point. - See Also:
-
getAllCoordinates
Returns all coordinate tuples in the wrapped geometry. This method is currently used for testing purpose only.- Specified by:
getAllCoordinatesin classGeometryWrapper<Shape>- Returns:
- the sequence of all coordinate values in the wrapped geometry,
or
nullif they cannot be obtained.
-
mergePolylines
Merges a sequence of points or paths after this geometry.- Specified by:
mergePolylinesin classGeometryWrapper<Shape>- Parameters:
polylines- the points or polylines to merge in a single polyline instance.- Returns:
- the merged polyline (may be the wrapper geometry but never
null). - Throws:
ClassCastException- if an element in the iterator is not aShapeor aPoint2D.
-
predicateSameCRS
Applies a filter predicate between this geometry and another geometry. This method assumes that the two geometries are in the same CRS (this is not verified).- Overrides:
predicateSameCRSin classGeometryWrapper<Shape>- Parameters:
type- the predicate operation to apply.other- the other geometry to test with this geometry.- Returns:
- result of applying the specified predicate.
-
operationSameCRS
Applies a SQLMM operation on this geometry.- Overrides:
operationSameCRSin classGeometryWrapper<Shape>- Parameters:
operation- the SQLMM operation to apply.other- the other geometry, ornullif the operation requires only one geometry.argument- an operation-specific argument, ornullif not applicable.- Returns:
- result of the specified operation.
-
equal
Estimates whether the wrapped geometry is equal to the geometry of the given wrapper.- Parameters:
wrapper- instance ofPointWrapper.
-
within
Estimates whether the wrapped geometry is contained by the geometry of the given wrapper. This method may conservatively returnsfalseif an accurate computation would be too expansive.- Parameters:
wrapper- instance ofWrapper.
-
intersect
Estimates whether the wrapped geometry intersects the geometry of the given wrapper. This method may conservatively returnstrueif an accurate computation would be too expansive.- Parameters:
wrapper- instance ofWrapperorPointWrapper.- Throws:
ClassCastException- if the given object is not a recognized wrapper.
-
formatWKT
Builds a WKT representation of the wrapped point.- Specified by:
formatWKTin classGeometryWrapper<Shape>- Parameters:
flatness- maximal distance between the approximated WKT and any point on the curve.- Returns:
- the Well Known Text for the wrapped geometry (never
null). - See Also:
-