Package hec.map.crs
Class CRS
java.lang.Object
hec.map.crs.CRS
Simple utility class for making use of the coordinate reference system and associated factory implementations. This
utility class is made up of static final functions. This class is not a
factory or a builder. It makes use of the Geo API factory interfaces provided
in this package.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Transform
findTransform
(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, boolean lenient) Finds a transform between two Coordinate Reference Systems.static CRS
abstract CoordinateReferenceSystem
Parses a WKT representation of a coordinate reference system into the specified type.
-
Constructor Details
-
CRS
public CRS()
-
-
Method Details
-
getDefault
-
parseWkt
Parses a WKT representation of a coordinate reference system into the specified type.- Parameters:
wkt
-- Returns:
- Throws:
CRSException
- if the underlying implementation can't parse the text. The exception error information is preserved.
-
findTransform
public abstract Transform findTransform(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, boolean lenient) throws CRSException Finds a transform between two Coordinate Reference Systems.If Lenient it can optionally tolerate lenient datum shift. If the
lenient
argument istrue
, then this method will not throw a "Bursa-Wolf parameters required" exception during datum shifts if the Bursa-Wolf paramaters are not specified. Instead it will assume a no datum shift.Sample use:
Transform transform = CRS.findTransform( CRS.parseWkt(wkt), CRS.parseWkt(wkt),false );
Source and Target CRS can be NULL. If they happen to be null, an Identity Transform is returned.
- Parameters:
sourceCRS
- The source CRS. Can be NULLtargetCRS
- The target CRS. Can be NULLlenient
-true
if the math transform should be created even when there is no information available for a datum shift. The default value isfalse
.- Returns:
- The math transform from
sourceCRS
totargetCRS
. - Throws:
CRSException
- If no transform can be created for the specified source and target CRS.
-