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.CoordinateReferenceSystemThe coordinate reference system, ornullif unspecified. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new instance initialized with null CRS. -
Method Summary
Modifier and TypeMethodDescriptionprotected final GeneralEnvelopeCreates an initially empty envelope with the CRS of this geometry.final org.opengis.referencing.crs.CoordinateReferenceSystemGets the Coordinate Reference System (CRS) of this geometry.final booleanisSameCRS(GeometryWrapper<G> other) Returnstrueif the given geometry use the same CRS than this geometry, or conservatively returnsfalsein case of doubt.final voidsetCoordinateReferenceSystem(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, ornullif 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:
getCoordinateReferenceSystemin classGeometryWrapper<G>- Returns:
- the geometry CRS, or
nullif unknown.
-
setCoordinateReferenceSystem
public final void setCoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem crs) Sets the coordinate reference system, which shall be two-dimensional.- Specified by:
setCoordinateReferenceSystemin classGeometryWrapper<G>- Parameters:
crs- the coordinate reference system to set.- See Also:
-
isSameCRS
Returnstrueif the given geometry use the same CRS than this geometry, or conservatively returnsfalsein 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:
isSameCRSin classGeometryWrapper<G>- Parameters:
other- the second geometry.- Returns:
trueif the two geometries use equivalent CRS or if the CRS is undefined on both side, orfalsein 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.
-