Enum CommonCRS

java.lang.Object
java.lang.Enum<CommonCRS>
org.apache.sis.referencing.CommonCRS
All Implemented Interfaces:
Serializable, Comparable<CommonCRS>, java.lang.constant.Constable

public enum CommonCRS extends Enum<CommonCRS>
Frequently-used geodetic CRS and datum that are guaranteed to be available in SIS. Some (not all) objects defined in this enumeration are equivalent to objects defined in the EPSG geodetic dataset. In such case there is a choice:
  • If the EPSG dataset is installed, then the methods in this enumeration are effectively shortcuts for object definitions in the EPSG database.
  • If there is no EPSG database available, or if the query failed, or if there is no EPSG definition for an object, then CommonCRS fallbacks on hard-coded values with minimal information. The identifier associated to the returned object should be interpreted as "see that EPSG code for more complete definition".
Consequently, the methods in this enumeration never return null. The definitions used as fallbacks are available in public sources and do not include EPSG metadata except the identifier. If the EPSG geodetic dataset has been used, the authority title will be something like "EPSG geodetic dataset", otherwise it will be "Subset of EPSG".

Referencing objects are cached after creation. Invoking the same method on the same CommonCRS instance twice will return the same IdentifiedObject instance, unless the internal cache has been cleared (e.g. the application is running in a container environment and some modules have been installed or uninstalled).

Example: the following code fetches a geographic Coordinate Reference System using (longitude, latitude) axis order on the WGS84 geodetic datum:
For each enumeration value, the name of the CRS, datum and ellipsoid objects may or may not be the same. Below is an alphabetical list of object names available in this enumeration:
Geodetic objects accessible by enumeration constants
Name or alias Object type Enumeration value
Clarke 1866 Ellipsoid NAD27
European Datum 1950 (ED50) CRS, datum ED50
European Terrestrial Reference System (ETRS) 1989 CRS, datum ETRS89
Greenwich Prime meridian Any enumeration value
GRS 1980 Ellipsoid GRS1980, ETRS89, NAD83
GRS 1980 Authalic Sphere Ellipsoid SPHERE
International 1924 Ellipsoid ED50
North American Datum 1927 CRS, datum NAD27
North American Datum 1983 CRS, datum NAD83
World Geodetic System (WGS) 1972 CRS, datum, ellipsoid WGS72
World Geodetic System (WGS) 1984 CRS, datum, ellipsoid WGS84
Since:
0.4
Version:
1.3
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Frequently-used engineering CRS and datum that are guaranteed to be available in SIS.
    static enum 
    Frequently-used temporal CRS and datum that are guaranteed to be available in SIS.
    static enum 
    Frequently-used vertical CRS and datum that are guaranteed to be available in SIS.

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    European Datum 1950 (ED50).
    European Terrestrial Reference System 1989.
    Unknown datum based upon the GRS 1980 ellipsoid.
    North American Datum 1927.
    North American Datum 1983.
    Unspecified datum based upon the GRS 1980 Authalic Sphere.
    World Geodetic System 1972.
    World Geodetic System 1984.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.opengis.referencing.IdentifiedObject
    The cached object.
    private org.opengis.referencing.crs.GeographicCRS
    The three-dimensional geographic CRS, created when first needed.
    private org.opengis.referencing.crs.GeocentricCRS
    The geocentric CRS using Cartesian coordinate system, created when first needed.
    private org.opengis.referencing.crs.GeographicCRS
    The normalized geographic CRS, created when first needed.
    private final Map<Integer,org.opengis.referencing.crs.ProjectedCRS>
    The Universal Transverse Mercator (UTM) or Universal Polar Stereographic (UPS) projections, created when first needed.
    private org.opengis.referencing.crs.GeocentricCRS
    The geocentric CRS using spherical coordinate system, created when first needed.
    (package private) final short
    The EPSG code of the datum.
    (package private) static final CommonCRS
    The enum for the default CRS.
    (package private) final short
    The EPSG code of the ellipsoid.
    (package private) final byte
    Zone number of the first UTM and last UTM zone defined in the EPSG database, inclusive.
    (package private) final short
    The EPSG code of the three-dimensional geographic CRS, or 0 if none.
    (package private) final short
    The EPSG code of the geocentric CRS, or 0 if none.
    (package private) final short
    The EPSG code of the two-dimensional geographic CRS.
    (package private) final byte
    Zone number of the first UTM and last UTM zone defined in the EPSG database, inclusive.
    (package private) final short
    EPSG codes of Universal Polar Stereographic projections, North and South cases.
    (package private) final short
    EPSG codes of pseudo "UTM zone zero" (North case and South case), or 0 if none.
    private static final int
    The special zone number used as key in cachedProjections for polar stereographic projections.
    (package private) final short
    EPSG codes of Universal Polar Stereographic projections, North and South cases.
    (package private) final short
    EPSG codes of pseudo "UTM zone zero" (North case and South case), or 0 if none.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    CommonCRS(short geographic, short geo3D, short geocentric, short datum, short ellipsoid, short northUPS, short southUPS, short northUTM, short southUTM, byte firstZone, byte lastZone)
    Creates a new constant for the given EPSG or SIS codes.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) final void
    Invoked by when the cache needs to be cleared after a classpath change.
    org.opengis.referencing.datum.GeodeticDatum
    Returns the geodetic datum associated to this geodetic object.
    private static org.opengis.referencing.datum.GeodeticDatum
    datum(org.opengis.referencing.IdentifiedObject object)
    Returns the datum associated to the given object, or null if none.
    static org.opengis.referencing.crs.GeographicCRS
    Returns the default two-dimensional normalized geographic CRS.
    org.opengis.referencing.datum.Ellipsoid
    Returns the ellipsoid associated to this geodetic object.
    private static org.opengis.referencing.datum.Ellipsoid
    ellipsoid(org.opengis.referencing.IdentifiedObject object)
    Returns the ellipsoid associated to the given object, or null if none.
    private static String[]
    Properties to exclude when using another object as a template.
    Returns the EPSG factory to use for creating CRS, or null if none.
    private static void
    failure(Object caller, String method, org.opengis.util.FactoryException e, int code)
    Invoked when a factory failed to create an object.
    static CommonCRS
    forDatum(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
    Returns the CommonCRS enumeration value for the datum of the given CRS.
    (package private) static CommonCRS
    forDatum(org.opengis.referencing.datum.GeodeticDatum datum)
    Returns the CommonCRS enumeration value for the given datum, or null if none.
    org.opengis.referencing.crs.GeocentricCRS
    Returns the geocentric CRS using a Cartesian coordinate system.
    org.opengis.referencing.crs.GeographicCRS
    Returns the two-dimensional geographic CRS with axes in the standard (latitude, longitude) order.
    private static org.opengis.referencing.crs.GeographicCRS
    geographic(org.opengis.referencing.IdentifiedObject object)
    Returns the geographic CRS associated to the given object, or null if none.
    org.opengis.referencing.crs.GeographicCRS
    Returns the three-dimensional geographic CRS with axes in the standard (latitude, longitude, height) order.
    org.opengis.referencing.crs.GeographicCRS
    Returns a two-dimensional geographic CRS with axes in the non-standard but computationally convenient (longitude, latitude) order.
    org.opengis.referencing.datum.PrimeMeridian
    Returns the prime meridian associated to this geodetic object.
    private static org.opengis.referencing.datum.PrimeMeridian
    primeMeridian(org.opengis.referencing.IdentifiedObject object)
    Returns the prime meridian associated to the given object, or null if none.
    private static Map<String,?>
    properties(short key)
    Puts the name for the given key in a map of properties to be given to object constructors.
    private static Map<String,?>
    properties(org.opengis.referencing.IdentifiedObject template, short code)
    Returns the same properties than the given object, except for the identifier which is set to the given code.
    private static Map<String,?>
    properties(org.opengis.util.InternationalString name)
    Puts the given name in a map of properties to be given to object constructors.
    org.opengis.referencing.crs.GeocentricCRS
    Returns the geocentric CRS using a spherical coordinate system.
    org.opengis.referencing.crs.ProjectedCRS
    universal(double latitude, double longitude)
    Returns a Universal Transverse Mercator (UTM) or a Universal Polar Stereographic (UPS) projection for the zone containing the given point.
    static CommonCRS
    Returns the enum constant of this type with the specified name.
    static CommonCRS[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • WGS84

      public static final CommonCRS WGS84
      World Geodetic System 1984. This is the default CRS for most org.apache.sis packages.
      WGS84 properties
      CRS identifiers: CRS:84, EPSG:4326
      Name and abbreviation: World Geodetic System 1984 (WGS 84)
      Prime meridian: Greenwich
      Semi-major axis length: 6378137 metres
      Semi-minor axis length: 6356752 metres (approximated)
      Inverse flattening: 298.257223563 (definitive)
      UTM zones: 1 to 60 in North and South hemispheres
    • WGS72

      public static final CommonCRS WGS72
      World Geodetic System 1972.
      WGS72 properties
      CRS identifiers: EPSG:4322
      Name and abbreviation: World Geodetic System 1972 (WGS 72)
      Prime meridian: Greenwich
      Semi-major axis length: 6378135 metres
      Semi-minor axis length: 6356751 metres (approximated)
      Inverse flattening: 298.26 (definitive)
      UTM zones: 1 to 60 in North and South hemispheres
    • NAD83

      public static final CommonCRS NAD83
      North American Datum 1983. The ellipsoid is "GRS 1980". This ellipsoid is very close, but not identical, to the WGS84 one.
      NAD83 properties
      CRS identifier: CRS:83, EPSG:4269
      Name and abbreviation: North American Datum 1983 (NAD83)
      Prime meridian: Greenwich
      Semi-major axis length: 6378137 metres
      Semi-minor axis length: 6356752 metres (approximated)
      Inverse flattening: 298.257222101 (definitive)
      UTM zones: 1 to 23 in the North hemisphere
      Note: ETRS89 uses the same ellipsoid for a different datum. The Web Map Server "CRS:83" authority code uses the NAD83 datum, while the "IGNF:MILLER" authority code uses the GRS80 datum.
    • NAD27

      public static final CommonCRS NAD27
      North American Datum 1927.
      NAD27 properties
      CRS identifiers: CRS:27, EPSG:4267
      Name and abbreviation: North American Datum 1927 (NAD27)
      Prime meridian: Greenwich
      Semi-major axis length: 6378206.4 metres
      Semi-minor axis length: 6356583.8 metres (definitive)
      UTM zones: 1 to 22 in the North hemisphere
    • ETRS89

      public static final CommonCRS ETRS89
      European Terrestrial Reference System 1989. The ellipsoid is "GRS 1980". This ellipsoid is very close, but not identical, to the WGS84 one.
      ETRS89 properties
      CRS identifiers: EPSG:4258
      Name and abbreviation: European Terrestrial Reference System 1989 (ETRS89)
      Prime meridian: Greenwich
      Semi-major axis length: 6378137 metres
      Semi-minor axis length: 6356752 metres (approximated)
      Inverse flattening: 298.257222101 (definitive)
      UTM zones: 28 to 37 in the North hemisphere
      Note: NAD83 uses the same ellipsoid for a different datum. The Web Map Server "CRS:83" authority code uses the NAD83 datum, while the "IGNF:MILLER" authority code uses the GRS80 datum.
    • ED50

      public static final CommonCRS ED50
      European Datum 1950 (ED50).
      ED50 properties
      CRS identifiers: EPSG:4230
      Name and abbreviation: European Datum 1950 (ED50)
      Prime meridian: Greenwich
      Semi-major axis length: 6378388 metres
      Semi-minor axis length: 6356912 metres (approximated)
      Inverse flattening: 297 (definitive)
      UTM zones: 28 to 38 in the North hemisphere
    • GRS1980

      public static final CommonCRS GRS1980
      Unknown datum based upon the GRS 1980 ellipsoid. Use only in cases where geodetic datum is unknown.
      GRS1980 properties
      CRS identifiers: EPSG:4019
      Name and abbreviation: Unknown datum based upon the GRS 1980 ellipsoid
      Prime meridian: Greenwich
      Semi-major axis length: 6378137 metres
      Semi-minor axis length: 6356752 metres (approximated)
      Inverse flattening: 298.257222101 (definitive)
      Since:
      1.0
    • SPHERE

      public static final CommonCRS SPHERE
      Unspecified datum based upon the GRS 1980 Authalic Sphere.
      Sphere properties
      CRS identifiers: EPSG:4047
      Name and abbreviation: Unspecified datum based upon the GRS 1980 Authalic Sphere
      Prime meridian: Greenwich
      Semi-major axis length: 6371007 metres
      Semi-minor axis length: 6371007 metres (definitive)
      See Also:
  • Field Details

    • DEFAULT

      static final CommonCRS DEFAULT
      The enum for the default CRS.
      See Also:
    • geographic

      final short geographic
      The EPSG code of the two-dimensional geographic CRS.
    • geo3D

      final short geo3D
      The EPSG code of the three-dimensional geographic CRS, or 0 if none. For non-zero value, this is often the geocentric code + 1.
    • geocentric

      final short geocentric
      The EPSG code of the geocentric CRS, or 0 if none.
    • datum

      final short datum
      The EPSG code of the datum. The value is often geographic + 2000, but it doesn't have to be always the case.
    • ellipsoid

      final short ellipsoid
      The EPSG code of the ellipsoid.
    • northUPS

      final short northUPS
      EPSG codes of Universal Polar Stereographic projections, North and South cases.
    • southUPS

      final short southUPS
      EPSG codes of Universal Polar Stereographic projections, North and South cases.
    • northUTM

      final short northUTM
      EPSG codes of pseudo "UTM zone zero" (North case and South case), or 0 if none.
    • southUTM

      final short southUTM
      EPSG codes of pseudo "UTM zone zero" (North case and South case), or 0 if none.
    • firstZone

      final byte firstZone
      Zone number of the first UTM and last UTM zone defined in the EPSG database, inclusive.
    • lastZone

      final byte lastZone
      Zone number of the first UTM and last UTM zone defined in the EPSG database, inclusive.
    • cached

      private transient volatile org.opengis.referencing.IdentifiedObject cached
      The cached object. This is initially null, then set to various kinds of objects depending on which method has been invoked. The kind of object stored in this field may change during the application execution.
    • cachedNormalized

      private transient volatile org.opengis.referencing.crs.GeographicCRS cachedNormalized
      The normalized geographic CRS, created when first needed.
      See Also:
    • cachedGeo3D

      private transient volatile org.opengis.referencing.crs.GeographicCRS cachedGeo3D
      The three-dimensional geographic CRS, created when first needed.
      See Also:
    • cachedGeocentric

      private transient volatile org.opengis.referencing.crs.GeocentricCRS cachedGeocentric
      The geocentric CRS using Cartesian coordinate system, created when first needed.
      See Also:
    • cachedSpherical

      private transient volatile org.opengis.referencing.crs.GeocentricCRS cachedSpherical
      The geocentric CRS using spherical coordinate system, created when first needed.
      See Also:
    • cachedProjections

      private final Map<Integer,org.opengis.referencing.crs.ProjectedCRS> cachedProjections
      The Universal Transverse Mercator (UTM) or Universal Polar Stereographic (UPS) projections, created when first needed. The UPS projections are arbitrarily given zone numbers 90 and -90 for North and South poles respectively.

      All accesses to this map shall be synchronized on cachedProjections.

      See Also:
    • POLAR

      private static final int POLAR
      The special zone number used as key in cachedProjections for polar stereographic projections. Must be outside the range of UTM zone numbers.
      See Also:
  • Constructor Details

    • CommonCRS

      private CommonCRS(short geographic, short geo3D, short geocentric, short datum, short ellipsoid, short northUPS, short southUPS, short northUTM, short southUTM, byte firstZone, byte lastZone)
      Creates a new constant for the given EPSG or SIS codes.
      Parameters:
      geographic - the EPSG code for the two-dimensional geographic CRS.
      geo3D - the EPSG code of the three-dimensional geographic CRS, or 0 if none.
      geocentric - the EPSG code of the geocentric CRS, or 0 if none.
      datum - the EPSG code for the datum.
      ellipsoid - the EPSG code for the ellipsoid.
  • Method Details

    • values

      public static CommonCRS[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static CommonCRS valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • clear

      final void clear()
      Invoked by when the cache needs to be cleared after a classpath change.
    • forDatum

      public static CommonCRS forDatum(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
      Returns the CommonCRS enumeration value for the datum of the given CRS. The given CRS shall comply to the following conditions (otherwise an IllegalArgumentException is thrown):
      • The crs is either an instance of SingleCRS, or an instance of CompoundCRS with an horizontal component.
      • The crs or the horizontal component of crs is associated to a GeodeticDatum.
      • The geodetic datum either
        • has the same EPSG code than one of the CommonCRS enumeration values, or
        • has no EPSG code but is equal, ignoring metadata, to the datum() value of one of the CommonCRS enumeration values.
      This method is useful for easier creation of various coordinate reference systems through the geographic(), geocentric() or other convenience methods when the set of datums supported by CommonCRS is known to be sufficient.
      Parameters:
      crs - the coordinate reference system for which to get a CommonCRS value.
      Returns:
      the CommonCRS value for the geodetic datum of the given CRS.
      Throws:
      IllegalArgumentException - if no CommonCRS value can be found for the given CRS.
      Since:
      0.8
      See Also:
    • forDatum

      static CommonCRS forDatum(org.opengis.referencing.datum.GeodeticDatum datum)
      Returns the CommonCRS enumeration value for the given datum, or null if none.
    • defaultGeographic

      public static org.opengis.referencing.crs.GeographicCRS defaultGeographic()
      Returns the default two-dimensional normalized geographic CRS. The CRS returned by this method has the following properties:
      • Axis order is (longitude, latitude).
      • Axis directions are (East, North).
      • Angular unit is Units.DEGREE.
      • Prime meridian in Greenwich.
      Note: This method makes no guarantees about the datum. The current default datum is WGS 84, but this may change in future SIS versions if a WGS 84 replacement become in wide use.
      This default CRS is assigned to envelopes created from a geographic bounding box. Since ISO 19115 GeographicBoundingBox is approximated by definition, their datum can be arbitrary.
      Returns:
      the default two-dimensional geographic CRS with (longitude, latitude) axis order.
    • normalizedGeographic

      public org.opengis.referencing.crs.GeographicCRS normalizedGeographic()
      Returns a two-dimensional geographic CRS with axes in the non-standard but computationally convenient (longitude, latitude) order. The coordinate system axes will be oriented toward East and North respectively, with units in degrees. The following table summarizes the coordinate reference systems known to this class, together with an enumeration value that can be used for fetching that CRS:
      Commonly used geographic CRS
      Name or alias Enum Code
      ED50 ED50
      ETRS89 ETRS89
      NAD27 NAD27 CRS:27
      NAD83 NAD83 CRS:83
      GRS 1980 GRS1980
      GRS 1980 Authalic Sphere SPHERE
      WGS 72 WGS72
      WGS 84 WGS84 CRS:84
      Returns:
      the geographic CRS with non-standard (longitude, latitude) axis order.
      See Also:
    • geographic

      public org.opengis.referencing.crs.GeographicCRS geographic()
      Returns the two-dimensional geographic CRS with axes in the standard (latitude, longitude) order. The coordinate system axes will be oriented toward North and East respectively, with units in degrees. The following table summarizes the coordinate reference systems known to this class, together with an enumeration value that can be used for fetching that CRS:
      Commonly used geographic CRS
      Name or alias Enum EPSG
      ED50 ED50 4230
      ETRS89 ETRS89 4258
      NAD27 NAD27 4267
      NAD83 NAD83 4269
      GRS 1980 GRS19804019
      GRS 1980 Authalic Sphere SPHERE 4047
      WGS 72 WGS72 4322
      WGS 84 WGS84 4326
      Returns:
      the geographic CRS with standard (latitude, longitude) axis order.
      See Also:
    • geographic3D

      public org.opengis.referencing.crs.GeographicCRS geographic3D()
      Returns the three-dimensional geographic CRS with axes in the standard (latitude, longitude, height) order. The following table summarizes the coordinate reference systems known to this class, together with an enumeration value that can be used for fetching that CRS:
      Commonly used geographic CRS
      Name or alias Enum EPSG
      ED50 ED50
      ETRS89 ETRS89 4937
      NAD27 NAD27
      NAD83 NAD83
      GRS 1980 GRS1980
      GRS 1980 Authalic Sphere SPHERE
      WGS 72 WGS72 4985
      WGS 84 WGS84 4979
      Returns:
      the three-dimensional geographic CRS associated to this enum.
      See Also:
    • geocentric

      public org.opengis.referencing.crs.GeocentricCRS geocentric()
      Returns the geocentric CRS using a Cartesian coordinate system. Axis units are metres. The following table summarizes the coordinate reference systems known to this class, together with an enumeration value that can be used for fetching that CRS:
      Commonly used geocentric CRS
      Name or alias Enum EPSG
      ED50 ED50
      ETRS89 ETRS89 4936
      NAD27 NAD27
      NAD83 NAD83
      GRS 1980 GRS1980
      GRS 1980 Authalic Sphere SPHERE
      WGS 72 WGS72 4984
      WGS 84 WGS84 4978
      Returns:
      the geocentric CRS associated to this enum.
      See Also:
    • spherical

      public org.opengis.referencing.crs.GeocentricCRS spherical()
      Returns the geocentric CRS using a spherical coordinate system. Axes are:
      1. Spherical latitude in degrees oriented toward north.
      2. Spherical longitude in degrees oriented toward east.
      3. Geocentric radius in metres oriented toward up.
      Returns:
      the geocentric CRS associated to this enum.
      Since:
      0.7
      See Also:
    • datum

      public org.opengis.referencing.datum.GeodeticDatum datum()
      Returns the geodetic datum associated to this geodetic object. The following table summarizes the datums known to this class, together with an enumeration value that can be used for fetching that datum:
      Commonly used geodetic datums
      Name or alias Enum EPSG
      European Datum 1950 ED50 6230
      European Terrestrial Reference System 1989 ETRS89 6258
      North American Datum 1927 NAD27 6267
      North American Datum 1983 NAD83 6269
      Not specified (based on GRS 1980 ellipsoid) GRS19806019
      Not specified (based on GRS 1980 Authalic Sphere) SPHERE 6047
      World Geodetic System 1972 WGS72 6322
      World Geodetic System 1984 WGS84 6326
      Returns:
      the geodetic datum associated to this enum.
      See Also:
    • ellipsoid

      public org.opengis.referencing.datum.Ellipsoid ellipsoid()
      Returns the ellipsoid associated to this geodetic object. The following table summarizes the ellipsoids known to this class, together with an enumeration value that can be used for fetching that ellipsoid:
      Commonly used ellipsoids
      Name or alias Enum EPSG
      Clarke 1866 NAD27 7008
      GRS 1980 GRS19807019
      GRS 1980 Authalic Sphere SPHERE 7048
      International 1924 ED50 7022
      World Geodetic System (WGS) 1972 WGS72 7043
      World Geodetic System (WGS) 1984 WGS84 7030
      Returns:
      the ellipsoid associated to this enum.
      See Also:
    • primeMeridian

      public org.opengis.referencing.datum.PrimeMeridian primeMeridian()
      Returns the prime meridian associated to this geodetic object. The following table summarizes the prime meridians known to this class, together with an enumeration value that can be used for fetching that prime meridian:
      Commonly used prime meridians
      Name or alias Enum EPSG
      Greenwich WGS84 8901
      Returns:
      the prime meridian associated to this enum.
      See Also:
    • geographic

      private static org.opengis.referencing.crs.GeographicCRS geographic(org.opengis.referencing.IdentifiedObject object)
      Returns the geographic CRS associated to the given object, or null if none.
    • datum

      private static org.opengis.referencing.datum.GeodeticDatum datum(org.opengis.referencing.IdentifiedObject object)
      Returns the datum associated to the given object, or null if none.
    • ellipsoid

      private static org.opengis.referencing.datum.Ellipsoid ellipsoid(org.opengis.referencing.IdentifiedObject object)
      Returns the ellipsoid associated to the given object, or null if none.
    • primeMeridian

      private static org.opengis.referencing.datum.PrimeMeridian primeMeridian(org.opengis.referencing.IdentifiedObject object)
      Returns the prime meridian associated to the given object, or null if none.
    • universal

      public org.opengis.referencing.crs.ProjectedCRS universal(double latitude, double longitude)
      Returns a Universal Transverse Mercator (UTM) or a Universal Polar Stereographic (UPS) projection for the zone containing the given point. There is a total of 120 UTM zones, with 60 zones in the North hemisphere and 60 zones in the South hemisphere. The projection zone is determined from the arguments as below:
      • If the latitude argument is less than 80°S or equal or greater than 84°N, then a Universal Polar Stereographic projection is created.
      • Otherwise a Universal Transverse Mercator projection is created as below:
        • The sign of the latitude argument determines the hemisphere: North for positive latitudes (including positive zero) or South for negative latitudes (including negative zero). The latitude magnitude is ignored, except for the special cases documented below and for ensuring that the latitude is inside the [-90 … 90]° range.
        • The value of the longitude argument determines the 6°-width zone, numbered from 1 for the zone starting at 180°W up to 60 for the zone finishing at 180°E. Longitudes outside the [-180 … 180]° range will be rolled as needed before to compute the zone.
        • Calculation of UTM zone involves two special cases (if those special cases are not desired, they can be avoided by making sure that the given latitude is below 56°N):
          • Between 56°N and 64°N, zone 32 is widened to 9° (at the expense of zone 31) to accommodate southwest Norway.
          • Between 72°N and 84°N, zones 33 and 35 are widened to 12° to accommodate Svalbard. To compensate for these 12° wide zones, zones 31 and 37 are widened to 9° and zones 32, 34, and 36 are eliminated.
      Tip: for "straight" UTM zone calculation without any special case (neither Norway, Svalbard or Universal Polar Stereographic projection), one can replace the latitude argument by Math.signum(latitude). For using a specific zone number, one can additionally replace the longitude argument by zone * 6 - 183.
      The map projection uses the following parameters:
      Universal Transverse Mercator (UTM) and Universal Polar Stereographic (UPS) projection parameters
      Parameter name UTM parameter value UPS parameter value
      Latitude of natural origin 90°N or 90°S depending on the sign of given latitude
      Longitude of natural origin Central meridian of the UTM zone containing the given longitude
      Scale factor at natural origin 0.9996 0.994
      False easting 500 000 metres 2 000 000 metres
      False northing 0 (North hemisphere) or 10 000 000 (South hemisphere) metres 2 000 000 metres
      The coordinate system axes are (Easting, Northing) in metres.
      Warning: be aware of parameter order! For this method, latitude is first. This order is for consistency with the non-normalized geographic CRS of all items in this CommonCRS enumeration.
      Parameters:
      latitude - a latitude in the desired UTM or UPS projection zone.
      longitude - a longitude in the desired UTM or UPS projection zone.
      Returns:
      a Universal Transverse Mercator or Polar Stereographic projection for the zone containing the given point.
      Since:
      0.8
    • properties

      private static Map<String,?> properties(short key)
      Puts the name for the given key in a map of properties to be given to object constructors.
      Parameters:
      key - a constant from Vocabulary.Keys.
      Returns:
      the properties to give to the object constructor.
    • properties

      private static Map<String,?> properties(org.opengis.util.InternationalString name)
      Puts the given name in a map of properties to be given to object constructors.
    • properties

      private static Map<String,?> properties(org.opengis.referencing.IdentifiedObject template, short code)
      Returns the same properties than the given object, except for the identifier which is set to the given code.
    • exclude

      private static String[] exclude()
      Properties to exclude when using another object as a template.
    • factory

      private static GeodeticAuthorityFactory factory()
      Returns the EPSG factory to use for creating CRS, or null if none. If this method returns null, then the caller will silently fallback on hard-coded values.
    • failure

      private static void failure(Object caller, String method, org.opengis.util.FactoryException e, int code)
      Invoked when a factory failed to create an object. After invoking this method, the caller will fallback on hard-coded values.