Class Wrapper
java.lang.Object
org.apache.sis.internal.feature.AbstractGeometry
org.apache.sis.internal.feature.GeometryWrapper<G>
org.apache.sis.internal.feature.GeometryWithCRS<com.esri.core.geometry.Geometry>
org.apache.sis.internal.feature.esri.Wrapper
- All Implemented Interfaces:
org.opengis.geometry.Geometry
The wrapper of ERSI geometries.
- Since:
- 1.1
- Version:
- 1.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
ImplementsBBOX
operator asNOT DISJOINT
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.esri.core.geometry.Geometry
The wrapped implementation.private static final Supplier<com.esri.core.geometry.OperatorSimpleRelation>[]
All predicates recognized bypredicateSameCRS(SpatialOperatorName, GeometryWrapper)
. -
Constructor Summary
ConstructorsConstructorDescriptionWrapper
(com.esri.core.geometry.Geometry geometry) Creates a new wrapper around the given geometry. -
Method Summary
Modifier and TypeMethodDescriptionGeometries<com.esri.core.geometry.Geometry>
factory()
Returns the implementation-dependent factory of geometric object.formatWKT
(double flatness) Returns the WKT representation of the wrapped geometry.double[]
Returns all coordinate tuples in the wrapped geometry.org.opengis.geometry.DirectPosition
Returns the centroid of the wrapped geometry as a direct position.Returns the ESRI envelope as an Apache SIS implementation.double[]
If the wrapped geometry is a point, returns its coordinates.Returns the geometry specified at construction time.protected com.esri.core.geometry.Geometry
mergePolylines
(Iterator<?> polylines) Merges a sequence of points or paths after the wrapped geometry.protected Object
operationSameCRS
(SQLMM operation, GeometryWrapper<com.esri.core.geometry.Geometry> other, Object argument) Applies a SQLMM operation on this geometry.protected boolean
predicateSameCRS
(SpatialOperatorName type, GeometryWrapper<com.esri.core.geometry.Geometry> other) Applies a filter predicate between this geometry and another geometry.private static com.esri.core.geometry.SpatialReference
srs()
Returns the spatial reference system of this geometrY.Methods inherited from class org.apache.sis.internal.feature.GeometryWithCRS
createEnvelope, getCoordinateReferenceSystem, isSameCRS, setCoordinateReferenceSystem
Methods 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
-
geometry
private final com.esri.core.geometry.Geometry geometryThe wrapped implementation. -
PREDICATES
All predicates recognized bypredicateSameCRS(SpatialOperatorName, GeometryWrapper)
. Array indices areEnum.ordinal()
values.
-
-
Constructor Details
-
Wrapper
Wrapper(com.esri.core.geometry.Geometry geometry) Creates a new wrapper around the given geometry.
-
-
Method Details
-
factory
Returns the implementation-dependent factory of geometric object.- Specified by:
factory
in classGeometryWrapper<com.esri.core.geometry.Geometry>
- Returns:
- the factory of implementation-dependent geometric objects (never
null
).
-
implementation
Returns the geometry specified at construction time.- Specified by:
implementation
in classGeometryWrapper<com.esri.core.geometry.Geometry>
- Returns:
- the geometry implementation wrapped by this instance (never
null
).
-
getEnvelope
Returns the ESRI envelope as an Apache SIS implementation.- Specified by:
getEnvelope
in classGeometryWrapper<com.esri.core.geometry.Geometry>
- Returns:
- the envelope.
-
getCentroid
public org.opengis.geometry.DirectPosition getCentroid()Returns the centroid of the wrapped geometry as a direct position.- Specified by:
getCentroid
in classGeometryWrapper<com.esri.core.geometry.Geometry>
- Returns:
- the centroid of the wrapped geometry.
-
getPointCoordinates
public double[] getPointCoordinates()If the wrapped geometry is a point, returns its coordinates. Otherwise returnsnull
. If non-null, the returned array may have a length of 2 or 3.- Specified by:
getPointCoordinates
in classGeometryWrapper<com.esri.core.geometry.Geometry>
- Returns:
- the coordinate of the point as an array of length 2 or 3,
or
null
if 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:
getAllCoordinates
in classGeometryWrapper<com.esri.core.geometry.Geometry>
- Returns:
- the sequence of all coordinate values in the wrapped geometry,
or
null
if they cannot be obtained.
-
mergePolylines
Merges a sequence of points or paths after the wrapped geometry.- Specified by:
mergePolylines
in classGeometryWrapper<com.esri.core.geometry.Geometry>
- 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 an ESRI geometry.
-
predicateSameCRS
protected boolean predicateSameCRS(SpatialOperatorName type, GeometryWrapper<com.esri.core.geometry.Geometry> other) 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).Note:
SpatialOperatorName.BBOX
is implemented byNOT DISJOINT
. It is caller's responsibility to ensure that one of the geometries is rectangular, for example by a call toGeometry#getEnvelope()
.- Overrides:
predicateSameCRS
in classGeometryWrapper<com.esri.core.geometry.Geometry>
- Parameters:
type
- the predicate operation to apply.other
- the other geometry to test with this geometry.- Returns:
- result of applying the specified predicate.
-
operationSameCRS
protected Object operationSameCRS(SQLMM operation, GeometryWrapper<com.esri.core.geometry.Geometry> other, Object argument) Applies a SQLMM operation on this geometry.- Overrides:
operationSameCRS
in classGeometryWrapper<com.esri.core.geometry.Geometry>
- Parameters:
operation
- the SQLMM operation to apply.other
- the other geometry, ornull
if the operation requires only one geometry.argument
- an operation-specific argument, ornull
if not applicable.- Returns:
- result of the specified operation.
-
srs
private static com.esri.core.geometry.SpatialReference srs()Returns the spatial reference system of this geometrY. This is currently only a placeholder for future development. -
formatWKT
Returns the WKT representation of the wrapped geometry.- Specified by:
formatWKT
in classGeometryWrapper<com.esri.core.geometry.Geometry>
- 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:
-