Package hec.map.crs

Class CRS

java.lang.Object
hec.map.crs.CRS

public abstract class CRS extends Object
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 Details

    • CRS

      public CRS()
  • Method Details

    • getDefault

      public static CRS getDefault()
    • parseWkt

      public abstract CoordinateReferenceSystem parseWkt(String wkt) throws CRSException
      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 is true, 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 NULL
      targetCRS - The target CRS. Can be NULL
      lenient - true if the math transform should be created even when there is no information available for a datum shift. The default value is false.

      Returns:
      The math transform from sourceCRS to targetCRS.

      Throws:
      CRSException - If no transform can be created for the specified source and target CRS.