mgrs-ios 1.1.6 Documentation

Class UTM

public class UTM  
  • Universal Transverse Mercator Projection

Initializers

init(_:​_:​_:​_:​)

public init(_ zone: Int, _ hemisphere: Hemisphere, _ easting: Double, _ northing: Double)  
  • Initialize
  • @param zone
  •        zone number
    
  • @param hemisphere
  •        hemisphere
    
  • @param easting
  •        easting
    
  • @param northing
  •        northing
    

Properties

zone

public let zone: Int
  • Zone number

hemisphere

public let hemisphere: Hemisphere
  • Hemisphere

easting

public let easting: Double
  • Easting

northing

public let northing: Double
  • Northing

description

public var description: String  

Methods

point(_:​_:​_:​_:​)

public static func point(_ zone: Int, _ hemisphere: Hemisphere, _ easting: Double, _ northing: Double) -> GridPoint  
  • Create a point from the UTM attributes
  • @param zone
  •        zone number
    
  • @param hemisphere
  •        hemisphere
    
  • @param easting
  •        easting
    
  • @param northing
  •        northing
    
  • @return point

to​Point()

public func toPoint() -> GridPoint  
  • Convert to a point
  • @return point

to​MGRS()

public func toMGRS() -> MGRS  
  • Convert to a MGRS coordinate
  • @return MGRS

to​Coordinate()

public func toCoordinate() -> CLLocationCoordinate2D  
  • Convert to a location coordinate
  • @return coordinate

format()

public func format() -> String  
  • Format to a UTM string
  • @return UTM string

is​UTM(_:​)

public static func isUTM(_ utm: String) -> Bool  
  • Return whether the given string is valid UTM string
  • @param utm
  •        potential UTM string
    
  • @return true if UTM string is valid, false otherwise

parse(_:​)

public static func parse(_ utm: String) -> UTM  
  • Parse a UTM value (Zone N|S Easting Northing)
  • @param utm
  •        UTM value
    
  • @return UTM

parse​ToCoordinate(_:​)

public static func parseToCoordinate(_ utm: String) -> CLLocationCoordinate2D  
  • Parse a UTM value (Zone N|S Easting Northing) into a location coordinate
  • @param utm
  •        UTM value
    
  • @return coordinate

from(_:​)

public static func from(_ point: GridPoint) -> UTM  
  • Create from a point
  • @param point
  •        point
    
  • @return UTM

from(_:​_:​)

public static func from(_ point: GridPoint, _ zone: Int) -> UTM  
  • Create from a point and zone number
  • @param point
  •        point
    
  • @param zone
  •        zone number
    
  • @return UTM

from(_:​_:​_:​)

public static func from(_ point: GridPoint, _ zone: Int, _ hemisphere: Hemisphere) -> UTM  
  • Create from a coordinate, zone number, and hemisphere
  • @param point
  •        coordinate
    
  • @param zone
  •        zone number
    
  • @param hemisphere
  •        hemisphere
    
  • @return UTM

from(_:​)

public static func from(_ coordinate: CLLocationCoordinate2D) -> UTM  
  • Create from a coordinate
  • @param coordinate
  •        coordinate
    
  • @return UTM

from(_:​_:​)

public static func from(_ longitude: Double, _ latitude: Double) -> UTM  
  • Create from a coordinate in degrees
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @return UTM

from(_:​_:​_:​)

public static func from(_ longitude: Double, _ latitude: Double, _ unit: grid_ios.Unit) -> UTM  
  • Create from a coordinate in the unit
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param unit
  •        unit
    
  • @return UTM

from(_:​_:​_:​)

public static func from(_ longitude: Double, _ latitude: Double, _ zone: Int) -> UTM  
  • Create from a coordinate in degrees and zone number
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param zone
  •        zone number
    
  • @return UTM

from(_:​_:​_:​_:​)

public static func from(_ longitude: Double, _ latitude: Double, _ unit: grid_ios.Unit, _ zone: Int) -> UTM  
  • Create from a coordinate in the unit and zone number
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param unit
  •        unit
    
  • @param zone
  •        zone number
    
  • @return UTM

from(_:​_:​_:​_:​)

public static func from(_ longitude: Double, _ latitude: Double, _ zone: Int, _ hemisphere: Hemisphere) -> UTM  
  • Create from a coordinate in degrees, zone number, and hemisphere
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param zone
  •        zone number
    
  • @param hemisphere
  •        hemisphere
    
  • @return UTM

from(_:​_:​_:​_:​_:​)

public static func from(_ longitude: Double, _ latitude: Double, _ unit: grid_ios.Unit, _ zone: Int, _ hemisphere: Hemisphere) -> UTM  
  • Create from a coordinate in the unit, zone number, and hemisphere
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param unit
  •        unit
    
  • @param zone
  •        zone number
    
  • @param hemisphere
  •        hemisphere
    
  • @return UTM

format(_:​)

public static func format(_ point: GridPoint) -> String  
  • Format to a UTM string from a point
  • @param point
  •        point
    
  • @return UTM string

format(_:​_:​)

public static func format(_ point: GridPoint, _ zone: Int) -> String  
  • Format to a UTM string from a point and zone number
  • @param point
  •        point
    
  • @param zone
  •        zone number
    
  • @return UTM string

format(_:​_:​_:​)

public static func format(_ point: GridPoint, _ zone: Int, _ hemisphere: Hemisphere) -> String  
  • Format to a UTM string from a coordinate, zone number, and hemisphere
  • @param point
  •        coordinate
    
  • @param zone
  •        zone number
    
  • @param hemisphere
  •        hemisphere
    
  • @return UTM string

format(_:​)

public static func format(_ coordinate: CLLocationCoordinate2D) -> String  
  • Format to a UTM string from a coordinate
  • @param coordinate
  •        coordinate
    
  • @return UTM string

format(_:​_:​)

public static func format(_ longitude: Double, _ latitude: Double) -> String  
  • Format to a UTM string from a coordinate in degrees
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @return UTM string

format(_:​_:​_:​)

public static func format(_ longitude: Double, _ latitude: Double, _ unit: grid_ios.Unit) -> String  
  • Format to a UTM string from a coordinate in the unit
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param unit
  •        unit
    
  • @return UTM string

format(_:​_:​_:​)

public static func format(_ longitude: Double, _ latitude: Double, _ zone: Int) -> String  
  • Format to a UTM string from a coordinate in degrees and zone number
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param zone
  •        zone number
    
  • @return UTM string

format(_:​_:​_:​_:​)

public static func format(_ longitude: Double, _ latitude: Double, _ unit: grid_ios.Unit, _ zone: Int) -> String  
  • Format to a UTM string from a coordinate in the unit and zone number
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param unit
  •        unit
    
  • @param zone
  •        zone number
    
  • @return UTM string

format(_:​_:​_:​_:​)

public static func format(_ longitude: Double, _ latitude: Double, _ zone: Int, _ hemisphere: Hemisphere) -> String  
  • Format to a UTM string from a coordinate in degrees, zone number, and hemisphere
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param zone
  •        zone number
    
  • @param hemisphere
  •        hemisphere
    
  • @return UTM string

format(_:​_:​_:​_:​_:​)

public static func format(_ longitude: Double, _ latitude: Double, _ unit: grid_ios.Unit, _ zone: Int, _ hemisphere: Hemisphere) -> String  
  • Format to a UTM string from a coordinate in the unit, zone number, and hemisphere
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param unit
  •        unit
    
  • @param zone
  •        zone number
    
  • @param hemisphere
  •        hemisphere
    
  • @return UTM string