Class UTM
- java.lang.Object
-
- org.jscience.geography.coordinates.Coordinates<ProjectedCRS<?>>
-
- org.jscience.geography.coordinates.UTM
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,javolution.lang.Immutable,javolution.lang.Realtime,javolution.lang.ValueType,javolution.xml.XMLSerializable,org.opengis.spatialschema.geometry.DirectPosition,org.opengis.spatialschema.geometry.geometry.Position,org.opengis.util.Cloneable
public final class UTM extends Coordinates<ProjectedCRS<?>>
This class represents theprojectedUniversal Transverse Mercator (UTM) coordinates onto the WGS84 ellipsoid.The UTM system is limited to values between -80 and +84 degrees latitude. Values beyond these limits (i.e., the polar regions) are projected using the Universal Polar Stereographic (UPS) projection. Although mathematically distinct, the two projections are represented identically. This class returns correct results for both UTM and UPS projections. The conversion routines for this class were derived from formulas described in the Defense Mapping Agency Technical Manual 8358.2.
- Version:
- 3.0, February 25, 2006
- Author:
- Paul D. Anderson
- See Also:
- Wikipedia: Universal Transverse Mercator Coordinate System, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ProjectedCRS<UTM>CRSHolds the coordinate reference system for all instances of this class.static javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Length>UPS_FALSE_EASTINGThe UPS "false easting" value.static javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Length>UPS_FALSE_NORTHINGThe UPS "false northing" value.static doubleUPS_SCALE_FACTORThe UPS scale factor.static javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Length>UTM_FALSE_EASTINGThe UTM "false easting" value.static javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Length>UTM_FALSE_NORTHINGThe UTM "false northing" value.static javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Angle>UTM_NORTHERN_LIMITThe northern limit of the UTM grid.static doubleUTM_SCALE_FACTORThe UTM scale factor.static javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Angle>UTM_SOUTHERN_LIMITThe southern limit of the UTM grid.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UTMcopy()Returns a copy of these coordinatesallocatedby the calling thread (possibly on the stack).doubleeastingValue(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)Returns the projected distance of the position from the central meridian.static doublegetCentralMeridian(int longitudeZone, char latitudeZone)Returns the central meridian (in radians) for the specified UTM/UPS zone.ProjectedCRS<UTM>getCoordinateReferenceSystem()Returns the reference system for this coordinates.intgetDimension()OpenGIS® - The length of coordinate sequence (the number of entries).static chargetLatitudeZone(LatLong latLong)Returns the UTM/UPS latitude zone identifier for the specified coordinates.static intgetLongitudeZone(LatLong latLong)Returns the UTM/UPS longitude zone number for the specified coordinates.doublegetOrdinate(int dimension)OpenGIS® - Returns the ordinate at the specified dimension.static booleanisNorthPolar(LatLong latLong)Returns true if the position indicated by the coordinates is north of the northern limit of the UTM grid (84 degrees).static booleanisSouthPolar(LatLong latLong)Returns true if the position indicated by the coordinates is south of the southern limit of the UTM grid (-80 degrees).charlatitudeZone()Returns the latitude zone identifier.static UTMlatLongToUps(LatLong latLong, ReferenceEllipsoid ellipsoid)Converts latitude/longitude coordinates to UPS coordinates based on the specified reference ellipsoid.static UTMlatLongToUtm(LatLong latLong, ReferenceEllipsoid ellipsoid)Converts latitude/longitude coordinates to UTM coordinates based on the specified reference ellipsoid.intlongitudeZone()Returns the longitude zone identifier.doublenorthingValue(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)Returns the projected distance of the point from the equator.static LatLongupsToLatLong(UTM ups, ReferenceEllipsoid ellipsoid)Converts the UPS coordinates to latitude/longitude coordinates, based on the specified reference ellipsoid.static LatLongutmToLatLong(UTM utm, ReferenceEllipsoid ellipsoid)Converts the UTM coordinates to latitude/longitude coordinates, based on the specified reference ellipsoid.static UTMvalueOf(int longitudeZone, char latitudeZone, double easting, double northing, javax.measure.unit.Unit<javax.measure.quantity.Length> unit)Returns the projected UTM position corresponding to the specified coordinates.-
Methods inherited from class org.jscience.geography.coordinates.Coordinates
clone, getCoordinates, getPosition, setOrdinate, toString, toText
-
-
-
-
Field Detail
-
UTM_SCALE_FACTOR
public static final double UTM_SCALE_FACTOR
The UTM scale factor. This the exact scale factor only on a pair of lines lying either side of the central meridian, but the effect is to reduce overall distortion within the UTM zone to less than one part per thousand.- See Also:
- Constant Field Values
-
UTM_FALSE_EASTING
public static javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Length> UTM_FALSE_EASTING
The UTM "false easting" value. This quantity is added to the true easting to avoid using negative numbers in the coordinates.
-
UTM_FALSE_NORTHING
public static javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Length> UTM_FALSE_NORTHING
The UTM "false northing" value. This quantity is added to the true northing for coordinates in the southern hemisphere only to avoid using negative numbers in the coordinates.
-
UTM_NORTHERN_LIMIT
public static final javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Angle> UTM_NORTHERN_LIMIT
The northern limit of the UTM grid. Beyond this limit the distortion introduced by the transverse Mercator projection is impractically large, and the UPS grid is used instead.
-
UTM_SOUTHERN_LIMIT
public static final javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Angle> UTM_SOUTHERN_LIMIT
The southern limit of the UTM grid. Beyond this limit the distortion introduced by the transverse Mercator projection is impractically large, and the UPS grid is used instead.
-
UPS_SCALE_FACTOR
public static final double UPS_SCALE_FACTOR
The UPS scale factor.- See Also:
- Constant Field Values
-
UPS_FALSE_EASTING
public static javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Length> UPS_FALSE_EASTING
The UPS "false easting" value. This quantity is added to the true easting to avoid using negative numbers in the coordinates.
-
UPS_FALSE_NORTHING
public static javax.measure.Measure<java.lang.Integer,javax.measure.quantity.Length> UPS_FALSE_NORTHING
The UPS "false northing" value. This quantity is added to the true northing to avoid using negative numbers in the coordinates. The UPS system, unlike the UTM system, always includes the false northing.
-
CRS
public static final ProjectedCRS<UTM> CRS
Holds the coordinate reference system for all instances of this class.
-
-
Method Detail
-
valueOf
public static UTM valueOf(int longitudeZone, char latitudeZone, double easting, double northing, javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
Returns the projected UTM position corresponding to the specified coordinates.- Parameters:
longitudeZone- the longitude zone number.latitudeZone- the longitude zone character.easting- the easting value stated in the specified unit.northing- the northing value stated in the specified unit.unit- the easting/northing length unit.- Returns:
- the corresponding surface position.
-
longitudeZone
public final int longitudeZone()
Returns the longitude zone identifier.- Returns:
- the longitude zone number.
-
latitudeZone
public final char latitudeZone()
Returns the latitude zone identifier.- Returns:
- the latitude zone character.
-
eastingValue
public final double eastingValue(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
Returns the projected distance of the position from the central meridian.- Parameters:
unit- the length unit of the easting to return.- Returns:
- the easting stated in the specified unit.
-
northingValue
public final double northingValue(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
Returns the projected distance of the point from the equator.- Parameters:
unit- the length unit of the northing to return.- Returns:
- the northing stated in the specified unit.
-
getCoordinateReferenceSystem
public ProjectedCRS<UTM> getCoordinateReferenceSystem()
Description copied from class:CoordinatesReturns the reference system for this coordinates.- Specified by:
getCoordinateReferenceSystemin interfaceorg.opengis.spatialschema.geometry.DirectPosition- Specified by:
getCoordinateReferenceSystemin classCoordinates<ProjectedCRS<?>>- Returns:
- the associated coordinate reference system.
-
getDimension
public int getDimension()
Description copied from class:CoordinatesOpenGIS® - The length of coordinate sequence (the number of entries). This is determined by the coordinate reference system.- Specified by:
getDimensionin interfaceorg.opengis.spatialschema.geometry.DirectPosition- Specified by:
getDimensionin classCoordinates<ProjectedCRS<?>>- Returns:
- the dimensionality of this position.
-
getOrdinate
public double getOrdinate(int dimension) throws java.lang.IndexOutOfBoundsException
Description copied from class:CoordinatesOpenGIS® - Returns the ordinate at the specified dimension.- Specified by:
getOrdinatein interfaceorg.opengis.spatialschema.geometry.DirectPosition- Specified by:
getOrdinatein classCoordinates<ProjectedCRS<?>>- Parameters:
dimension- The dimension in the range 0 to dimension-1.- Returns:
- The coordinate at the specified dimension.
- Throws:
java.lang.IndexOutOfBoundsException- if the specified dimension is out of bounds.
-
isNorthPolar
public static boolean isNorthPolar(LatLong latLong)
Returns true if the position indicated by the coordinates is north of the northern limit of the UTM grid (84 degrees).- Parameters:
latLong- The coordinates.- Returns:
- True if the latitude is greater than 84 degrees.
-
isSouthPolar
public static boolean isSouthPolar(LatLong latLong)
Returns true if the position indicated by the coordinates is south of the southern limit of the UTM grid (-80 degrees).- Parameters:
latLong- The coordinates.- Returns:
- True if the latitude is less than -80 degrees.
-
getLatitudeZone
public static char getLatitudeZone(LatLong latLong)
Returns the UTM/UPS latitude zone identifier for the specified coordinates.- Parameters:
latLong- The coordinates.- Returns:
- the latitude zone character.
-
getLongitudeZone
public static int getLongitudeZone(LatLong latLong)
Returns the UTM/UPS longitude zone number for the specified coordinates.- Parameters:
latLong- The coordinates.- Returns:
- the longitude zone number.
-
getCentralMeridian
public static double getCentralMeridian(int longitudeZone, char latitudeZone)
Returns the central meridian (in radians) for the specified UTM/UPS zone.- Parameters:
longitudeZone- The UTM/UPS longitude zone number.latitudeZone- The UTM/UPS latitude zone character.- Returns:
- The central meridian for the specified zone.
-
latLongToUtm
public static UTM latLongToUtm(LatLong latLong, ReferenceEllipsoid ellipsoid)
Converts latitude/longitude coordinates to UTM coordinates based on the specified reference ellipsoid.- Parameters:
latLong- The latitude/longitude coordinates.ellipsoid- The reference ellipsoid.- Returns:
- The UTM coordinates.
-
latLongToUps
public static UTM latLongToUps(LatLong latLong, ReferenceEllipsoid ellipsoid)
Converts latitude/longitude coordinates to UPS coordinates based on the specified reference ellipsoid.- Parameters:
latLong- The latitude/longitude coordinates.ellipsoid- The reference ellipsoid.- Returns:
- The UPS coordinates.
-
utmToLatLong
public static LatLong utmToLatLong(UTM utm, ReferenceEllipsoid ellipsoid)
Converts the UTM coordinates to latitude/longitude coordinates, based on the specified reference ellipsoid.- Parameters:
utm- The UTM coordinates.ellipsoid- The reference ellipsoid.- Returns:
- The latitude/longitude coordinates.
-
upsToLatLong
public static LatLong upsToLatLong(UTM ups, ReferenceEllipsoid ellipsoid)
Converts the UPS coordinates to latitude/longitude coordinates, based on the specified reference ellipsoid.- Parameters:
ups- The UPS coordinates.ellipsoid- The reference ellipsoid.- Returns:
- The latitude/longitude coordinates.
-
copy
public UTM copy()
Description copied from class:CoordinatesReturns a copy of these coordinatesallocatedby the calling thread (possibly on the stack).- Specified by:
copyin interfacejavolution.lang.ValueType- Specified by:
copyin classCoordinates<ProjectedCRS<?>>- Returns:
- an identical and independant copy of these coordinates .
-
-