Documentation
¶
Overview ¶
Package utm provides the ability to work with UTM coordinates
References: https://stevedutch.net/FieldMethods/UTMSystem.htm https://gisgeography.com/central-meridian/
Index ¶
Constants ¶
const ( // ErrInvalidZone will be return if the given zone is invalid ErrInvalidZone = errors.String("zone is invalid") // ErrLatitudeOutOfRange will be returned if the latitude is not in the correct range of acceptable values ErrLatitudeOutOfRange = errors.String("latitude out of range") )
Variables ¶
This section is empty.
Functions ¶
func CentralMeridian ¶
CentralMeridian returns the central meridian degree for the given zone.
Possible errors:
ErrInvalidZone
func ScalarFactor ¶
ScalarFactor will calculate the correct k scalar value for the given lnglat and eccentricity
func ZoneNumberFromLngLat ¶
ZoneNumberFromLngLat will get the zone number for the given LngLat value.
The returned value will be from 1-60. If 0 is returned it means that the lat,lng value was in the polar region and UPS should be used instead.
Transcribed from: https://github.com/gdey/GDGeoCocoa/blob/master/GDGeoCoordConv.m
Types ¶
type Coord ¶
Coord defines an UTM coordinate
func FromLngLat ¶
FromLngLat returns a new utm coordinate based on the provided longitude and latitude values.
func (Coord) NatoEasting ¶
NatoEasting returns the easting value for NATO
func (Coord) NatoNorthing ¶
NatoNorthing returns the northing value for NATO
type Zone ¶
type Zone struct { Number int Letter ZoneLetter }
Zone describes an UTM zone
func NewZone ¶
NewZone returns the UTM zone for the given LngLat value.
Possible errors:
ErrLatitudeOutOfRange
func (Zone) IsNorthern ¶
IsNorthern returns if the Zone is in the northern hemisphere
type ZoneLetter ¶
type ZoneLetter byte
ZoneLetter describes the UTM zone letter
const ( ZoneC ZoneLetter = 'C' ZoneD ZoneLetter = 'D' ZoneE ZoneLetter = 'E' ZoneF ZoneLetter = 'F' ZoneG ZoneLetter = 'G' ZoneH ZoneLetter = 'H' ZoneI ZoneLetter = 'I' ZoneJ ZoneLetter = 'J' ZoneK ZoneLetter = 'K' ZoneL ZoneLetter = 'L' ZoneM ZoneLetter = 'M' ZoneN ZoneLetter = 'N' ZoneP ZoneLetter = 'P' ZoneQ ZoneLetter = 'Q' ZoneR ZoneLetter = 'R' ZoneS ZoneLetter = 'S' ZoneT ZoneLetter = 'T' ZoneU ZoneLetter = 'U' ZoneV ZoneLetter = 'V' ZoneW ZoneLetter = 'W' ZoneX ZoneLetter = 'X' )
UTM Zone Letters
func ZoneLetterForLat ¶
func ZoneLetterForLat(lat float64) (ZoneLetter, error)
ZoneLetterForLat returns the UTM zone letter for the given latitude value
Possible errors:
ErrLatitudeOutOfRange
func (ZoneLetter) IsNorthern ¶
func (zl ZoneLetter) IsNorthern() bool
IsNorthern returns if the Zone is in the northern hemisphere
func (ZoneLetter) IsValid ¶
func (zl ZoneLetter) IsValid() bool
IsValid will run validity check on the zone letter and number
func (ZoneLetter) String ¶
func (zl ZoneLetter) String() string
String implements the stringer interface