geodetics-1.1.0: Terrestrial coordinate systems and geodetic calculations.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Geodetics.UTM

Description

Universal Transverse Mercator (UTM)

The UTM grid system covers the whole world between 84°N and 80°S. It divides the world into grid zones of 6° longitude by 8° latitude. Each zone has a 2 digit number for longitude and a letter for latitude. This regular system has two exceptions:

  • North of Norway the zones 32X, 34X and 36X are not used, with 31X, 33X, 35X and 37X being wider instead.
  • Zone 32V is widened to cover the south-western end of Norway.

There are two notations for writing UTM grid positions:

  • The UTM standard: Zone number, N or S for hemisphere, and then northings and eastings relative to the equator.
  • The Military Grid Reference System (MGRS): Zone number, latitude band letter, a 2 letter code for the 100km square within the zone, and then northings and eastings within that square.

In this library each UTM longitude zone has two grids, one for the northern hemisphere and one for the south.

For more details see

Synopsis

Documentation

data UtmHemisphere Source #

In UTM the northern and southern hemispheres have different false origins.

Constructors

UtmNorth 
UtmSouth 

Instances

Instances details
Show UtmHemisphere Source # 
Instance details

Defined in Geodetics.UTM

Eq UtmHemisphere Source # 
Instance details

Defined in Geodetics.UTM

type UtmZoneNumber = Int Source #

A UTM Zone number. Must be between 1 and 60.

data UtmZone Source #

A UTM Zone, representing a band of typically 6 degrees of latitude between the equator and one of the poles. The projection *must* match the hemisphere and zone.

Instances

Instances details
Show UtmZone Source # 
Instance details

Defined in Geodetics.UTM

Eq UtmZone Source # 
Instance details

Defined in Geodetics.UTM

Methods

(==) :: UtmZone -> UtmZone -> Bool #

(/=) :: UtmZone -> UtmZone -> Bool #

GridClass UtmZone WGS84 Source # 
Instance details

Defined in Geodetics.UTM

utmZone :: Geodetic a -> Maybe UtmZone Source #

The UTM Zone for the given location, if it exists.

mkUtmZone :: UtmHemisphere -> UtmZoneNumber -> Maybe UtmZone Source #

Construct a UTM Zone value. Returns Nothing if the zone number is out of range.

mkUtmZoneUnsafe :: UtmHemisphere -> UtmZoneNumber -> UtmZone Source #

Construct a UTM Zone value without checking whether the zone number is valid.

fromUtmGridReference :: String -> Either [String] (GridPoint UtmZone) Source #

Convert a grid reference to a position, if the reference is valid.

The northings and eastings cannot contain more than 20 digits each, including an optional decimal point. Negative values are not permitted.

Northings and eastings can each be followed by an optional unit. The unit must be either "m" or "km". The units for both must be the same because otherwise its probably an error. The default is meters.

Northings may be followed by an "N" and Eastings may be followed by an "E".

If the argument cannot be parsed then one or more error messages are returned.

toUtmGridReference Source #

Arguments

:: Maybe UtmGridUnit

Include explicit units in the output. Nothing means meters without units.

-> Bool

Include "E" and "N" in the output.

-> Int

Digits of resolution. 0 = 1m resolution, 1 = 10m, 2 = 100m etc. (-2) = 1cm.

-> GridPoint UtmZone 
-> String 

Convert a grid point to a UTM grid reference. The northings and eastings are rounded down to the resolution, so the result is the south-west corner of the grid square enclosing the grid point.

mgrsBandLetterToLatitude :: Char -> Maybe Double Source #

Find the southern boundary of a latitude band letter.

mgrsLatitudeToBandLetter :: Double -> Maybe Char Source #

Find the band letter for a latitude, if it is in the range (-80, 84) degrees. (Argument in radians)

fromMgrsGridReference :: String -> Either [String] (GridPoint UtmZone, GridOffset) Source #

Convert an MGRS grid reference to a UTM GridPoint, if the reference is valid. E.g. "30U XC 99304 10208" is the grid reference for Nelson's Column in London.

If the input contains spaces then these are used to delimit the fields. Any or all spaces may be omitted. Multiple spaces are treated as a single space.

If the reference is valid this returns the position of the south-west corner of the nominated grid square and an offset to its centre. Altitude is set to zero.

toMgrsGridReference Source #

Arguments

:: Bool

Include spaces in the output. The standard says no spaces, but they make the output easier to read.

-> Int

Number of digits of precision in the easting and northing. Must be 0-5.

-> GridPoint UtmZone 
-> Maybe String 

Convert UTM GridPoint to an MGRS grid reference.