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
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal 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
ConstructorsModifierConstructorDescriptionprivate
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 TypeMethodDescriptionfinal 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.static TransverseMercator.Zoner
Returns the enum constant of this type with the specified name.static TransverseMercator.Zoner[]
values()
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.
-
Enum Constant Details
-
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 0° 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
Modified Transverse Mercator (MTM) projection zones. This projection is used in Canada only.Modified Transverse Mercator parameters Parameter name Value Latitude of natural origin 0° 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
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 originLongitude of the beginning of zone 1. This is the westmost longitude ifwidth
is positive, or the eastmost longitude ifwidth
is negative. -
width
public final double widthWidth 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 scaleThe scale factor of zoned projections. -
easting
public final double eastingThe false easting of zoned projections, in metres. -
northing
public final double northingThe false northing in South hemisphere of zoned projection, in metres. -
SOUTH_BOUNDS
public static final double SOUTH_BOUNDSSouthernmost bound of the first latitude band ('C'
), inclusive.- See Also:
-
NORWAY_BOUNDS
private static final double NORWAY_BOUNDSSouthernmost 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_BOUNDSSouthernmost 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_BOUNDSNorthernmost 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
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
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 nameNullPointerException
- 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:
\u03c6
- a latitude for which to get the zone. Used for taking in account the special cases.\u03bb
- 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.\u03c6
- 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:
\u03c6min
- southernmost latitude in degrees.\u03c6max
- northernmost latitude in degrees.\u03bbmin
- westernmost longitude in degrees.\u03bbmax
- 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 forMilitaryGridReferenceSystemTest.verifyZonerConsistency()
purpose only.- Parameters:
\u03c6
- 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 forMilitaryGridReferenceSystemTest.verifyZonerConsistency()
purpose only.- Parameters:
\u03c6
- the latitude in degrees to test.- Returns:
- whether the given latitude is in the Svalbard latitude band.
-