Enum TransverseMercator.Zoner

java.lang.Object
java.lang.Enum<TransverseMercator.Zoner>
org.apache.sis.internal.referencing.provider.TransverseMercator.Zoner
All Implemented Interfaces:
Serializable, Comparable<TransverseMercator.Zoner>, java.lang.constant.Constable
Enclosing class:
TransverseMercator

public static enum TransverseMercator.Zoner extends Enum<TransverseMercator.Zoner>
Computes zone numbers and central meridian.
Since:
0.8
Version:
0.8
  • Nested Class Summary

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

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

    Enum Constants
    Enum Constant
    Description
    Like UTM, but allows latitude of origin and central meridian to be anywhere.
    Modified Transverse Mercator (MTM) projection zones.
    Universal Transverse Mercator (UTM) projection zones.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
    The false easting of zoned projections, in metres.
    static final double
    Northernmost bound of the last latitude band ('X'), exclusive.
    final double
    The false northing in South hemisphere of zoned projection, in metres.
    private static final double
    Southernmost bounds (inclusive) of the latitude band that contains Norway ('V').
    final double
    Longitude of the beginning of zone 1.
    final double
    The scale factor of zoned projections.
    static final double
    Southernmost bound of the first latitude band ('C'), inclusive.
    static final double
    Southernmost bounds (inclusive) of the last latitude band, which contains Svalbard.
    final double
    Width of a zone, in degrees of longitude.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Zoner(double origin, double width, double scale, double easting, double northing)
    Creates a new instance for computing zones using the given parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    final double
    centralMeridian(int zone)
    Computes the central meridian of a given zone.
    static boolean
    isNorway(double φ)
    First exception in UTM projection, corresponding to latitude band V.
    boolean
    isSpecialCase(double φmin, double φmax, double λmin, double λmax)
    Indicates whether the given geographic area intersects the regions that need to be handled in a special way.
    boolean
    isSpecialCase(int zone, double φ)
    Indicates whether the given zone needs to be handled in a special way for the given latitude.
    static boolean
    isSvalbard(double φ)
    Second exception in UTM projection, corresponding to latitude band X.
    final String
    setParameters(org.opengis.parameter.ParameterValueGroup group, double latitude, double longitude)
    Sets the parameter values for a Transverse Mercator projection and returns a suggested conversion name.
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.
    int
    zone(double φ, double λ)
    Computes the zone from a meridian in the zone.
    final int
    zone(org.opengis.parameter.ParameterValueGroup group)
    If the given parameter values are those of a zoned projection, returns the zone number (negative if South).
    final int
    Returns the number of zones.

    Methods inherited from class java.lang.Object

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

    • UTM

      public static final TransverseMercator.Zoner UTM
      Universal Transverse Mercator (UTM) projection zones. The zone computation includes special cases for Norway and Svalbard.
      Universal Transverse Mercator parameters
      Parameter name Value
      Latitude of natural origin
      Longitude of natural origin Given longitude snapped to a UTM central meridian
      Scale factor at natural origin 0.9996
      False easting 500000 metres
      False northing 0 (North hemisphere) or 10000000 (South hemisphere) metres
    • MTM

      public static final TransverseMercator.Zoner MTM
      Modified Transverse Mercator (MTM) projection zones. This projection is used in Canada only.
      Modified Transverse Mercator parameters
      Parameter name Value
      Latitude of natural origin
      Longitude of natural origin Given longitude snapped to a MTM central meridian
      Scale factor at natural origin 0.9999
      False easting 304800 metres
      False northing 0 metres
    • ANY

      public static final TransverseMercator.Zoner ANY
      Like UTM, but allows latitude of origin and central meridian to be anywhere. The given central meridian is not snapped to the UTM zone center and no special case is applied for Norway or Svalbard.

      This zoner matches the behavior of AUTO(2):42002 authority code specified in the OGC Web Map Service (WMS) specification.

  • Field Details

    • origin

      public final double origin
      Longitude of the beginning of zone 1. This is the westmost longitude if width is positive, or the eastmost longitude if width is negative.
    • width

      public final double width
      Width of a zone, in degrees of longitude. Positive if zone numbers are increasing eastward, or negative if increasing westwards.
      See Also:
    • scale

      public final double scale
      The scale factor of zoned projections.
    • easting

      public final double easting
      The false easting of zoned projections, in metres.
    • northing

      public final double northing
      The false northing in South hemisphere of zoned projection, in metres.
    • SOUTH_BOUNDS

      public static final double SOUTH_BOUNDS
      Southernmost bound of the first latitude band ('C'), inclusive.
      See Also:
    • NORWAY_BOUNDS

      private static final double NORWAY_BOUNDS
      Southernmost bounds (inclusive) of the latitude band that contains Norway ('V'). This is the first latitude band where we may need to handle special cases (Norway and Svalbard).
      See Also:
    • SVALBARD_BOUNDS

      public static final double SVALBARD_BOUNDS
      Southernmost bounds (inclusive) of the last latitude band, which contains Svalbard. This latitude band is 12° height instead of 8°.
      See Also:
    • NORTH_BOUNDS

      public static final double NORTH_BOUNDS
      Northernmost bound of the last latitude band ('X'), exclusive.
      See Also:
  • Constructor Details

    • Zoner

      private Zoner(double origin, double width, double scale, double easting, double northing)
      Creates a new instance for computing zones using the given parameters.
  • Method Details

    • values

      public static TransverseMercator.Zoner[] 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 TransverseMercator.Zoner 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
    • setParameters

      public final String setParameters(org.opengis.parameter.ParameterValueGroup group, double latitude, double longitude)
      Sets the parameter values for a Transverse Mercator projection and returns a suggested conversion name.
      Transverse Mercator parameters
      Parameter name Value
      Latitude of natural origin Given latitude, or 0° if zoned projection
      Longitude of natural origin Given longitude, optionally snapped to a zone central meridian
      Scale factor at natural origin 0.9996 for UTM or 0.9999 for MTM
      False easting 500000 metres for UTM or 304800 metres for MTM
      False northing 0 (North hemisphere) or 10000000 (South hemisphere) metres
      Parameters:
      group - the parameters for which to set the values.
      latitude - the latitude in the center of the desired projection.
      longitude - the longitude in the center of the desired projection.
      Returns:
      a name like "Transverse Mercator" or "UTM zone 10N", depending on the arguments given to this method.
    • zone

      public final int zone(org.opengis.parameter.ParameterValueGroup group)
      If the given parameter values are those of a zoned projection, returns the zone number (negative if South). Otherwise returns 0. It is caller's responsibility to verify that the operation method is "Transverse Mercator".
      Parameters:
      group - the Transverse Mercator projection parameters.
      Returns:
      zone number (positive if North, negative if South), or 0 if the given parameters are not for a zoned projection.
    • zone

      public int zone(double φ, double λ)
      Computes the zone from a meridian in the zone.
      Parameters:
      φ - a latitude for which to get the zone. Used for taking in account the special cases.
      λ - a meridian inside the desired zone, in degrees relative to Greenwich. Positive longitudes are toward east, and negative longitudes toward west.
      Returns:
      the zone number numbered from 1 inclusive, or 0 if the given central meridian was NaN.
    • zoneCount

      public final int zoneCount()
      Returns the number of zones.
      Returns:
      number of zones.
    • centralMeridian

      public final double centralMeridian(int zone)
      Computes the central meridian of a given zone.
      Parameters:
      zone - the zone as a number starting with 1.
      Returns:
      the central meridian of the given zone.
    • isSpecialCase

      public boolean isSpecialCase(int zone, double φ)
      Indicates whether the given zone needs to be handled in a special way for the given latitude.
      Parameters:
      zone - the zone to test if it is a special case.
      φ - the latitude for which to test if there is a special case.
      Returns:
      whether the given zone at the given latitude is a special case.
    • isSpecialCase

      public boolean isSpecialCase(double φmin, double φmax, double λmin, double λmax)
      Indicates whether the given geographic area intersects the regions that need to be handled in a special way.
      Parameters:
      φmin - southernmost latitude in degrees.
      φmax - northernmost latitude in degrees.
      λmin - westernmost longitude in degrees.
      λmax - easternmost longitude in degrees.
      Returns:
      whether the given area intersects a region that needs to be handled as a special case.
    • isNorway

      public static boolean isNorway(double φ)
      First exception in UTM projection, corresponding to latitude band V. This method is public for MilitaryGridReferenceSystemTest.verifyZonerConsistency() purpose only.
      Parameters:
      φ - the latitude in degrees to test.
      Returns:
      whether the given latitude is in the Norway latitude band.
    • isSvalbard

      public static boolean isSvalbard(double φ)
      Second exception in UTM projection, corresponding to latitude band X. This method is public for MilitaryGridReferenceSystemTest.verifyZonerConsistency() purpose only.
      Parameters:
      φ - the latitude in degrees to test.
      Returns:
      whether the given latitude is in the Svalbard latitude band.