Package org.apache.sis.internal.feature
Class GeometryWithCRS<G>
java.lang.Object
org.apache.sis.internal.feature.AbstractGeometry
org.apache.sis.internal.feature.GeometryWrapper<G>
org.apache.sis.internal.feature.GeometryWithCRS<G>
- Type Parameters:
G
- root class of geometry instances of the underlying library.
- All Implemented Interfaces:
org.opengis.geometry.Geometry
- Direct Known Subclasses:
PointWrapper
,Wrapper
,Wrapper
A geometry wrapper with a field for CRS information. This base class is used when the geometry implementation
to wrap does not store CRS information by itself. See
GeometryWrapper
for more information.- Since:
- 1.1
- Version:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.opengis.referencing.crs.CoordinateReferenceSystem
The coordinate reference system, ornull
if unspecified. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a new instance initialized with null CRS. -
Method Summary
Modifier and TypeMethodDescriptionprotected final GeneralEnvelope
Creates an initially empty envelope with the CRS of this geometry.final org.opengis.referencing.crs.CoordinateReferenceSystem
Gets the Coordinate Reference System (CRS) of this geometry.final boolean
isSameCRS
(GeometryWrapper<G> other) Returnstrue
if the given geometry use the same CRS than this geometry, or conservatively returnsfalse
in case of doubt.final void
setCoordinateReferenceSystem
(org.opengis.referencing.crs.CoordinateReferenceSystem crs) Sets the coordinate reference system, which shall be two-dimensional.Methods inherited from class org.apache.sis.internal.feature.GeometryWrapper
equals, factory, formatWKT, getAllCoordinates, getCentroid, getEnvelope, getPointCoordinates, getSRID, hashCode, implementation, mergePolylines, operation, operation, operationSameCRS, operationWithArgument, operationWithArgument, predicate, predicate, predicateSameCRS, predicateSameCRS, toGeometryType, toString, transform, transform
-
Field Details
-
crs
private org.opengis.referencing.crs.CoordinateReferenceSystem crsThe coordinate reference system, ornull
if unspecified.
-
-
Constructor Details
-
GeometryWithCRS
protected GeometryWithCRS()Creates a new instance initialized with null CRS.
-
-
Method Details
-
getCoordinateReferenceSystem
public final org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()Gets the Coordinate Reference System (CRS) of this geometry.- Specified by:
getCoordinateReferenceSystem
in classGeometryWrapper<G>
- Returns:
- the geometry CRS, or
null
if unknown.
-
setCoordinateReferenceSystem
public final void setCoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem crs) Sets the coordinate reference system, which shall be two-dimensional.- Specified by:
setCoordinateReferenceSystem
in classGeometryWrapper<G>
- Parameters:
crs
- the coordinate reference system to set.- See Also:
-
isSameCRS
Returnstrue
if the given geometry use the same CRS than this geometry, or conservatively returnsfalse
in case of doubt. This method should perform only a cheap test; it is used as a way to filter rapidly ifGeometryWrapper.transform(CoordinateReferenceSystem)
needs to be invoked.- Specified by:
isSameCRS
in classGeometryWrapper<G>
- Parameters:
other
- the second geometry.- Returns:
true
if the two geometries use equivalent CRS or if the CRS is undefined on both side, orfalse
in case of doubt.
-
createEnvelope
Creates an initially empty envelope with the CRS of this geometry. If this geometry has no CRS, then a two-dimensional envelope is created. This is a convenience method forGeometryWrapper.getEnvelope()
implementations.- Returns:
- an initially empty envelope.
-