Class
GARSUtils
public class GARSUtils
- Global Area Reference System utilities
Methods
longitude(_:)
public static func longitude(_ band: Int) -> Double
- Get the longitude from the longitude band
- @param band
-
longitudinal band number
- @return longitude
latitude(_:)
public static func latitude(_ band: String) -> Double
- Get the latitude from the latitude band letters
- @param band
-
latitudinal band letters
- @return latitude
latitude(_:)
public static func latitude(_ band: Int) -> Double
- Get the latitude from the latitude band letters number equivalent
- @param band
-
latitudinal band number
- @return latitude
longitudeBand(_:)
public static func longitudeBand(_ longitude: Double) -> Int
- Get the longitude band from the longitude
- @param longitude
-
longitude
- @return longitude band
longitudeDecimalBand(_:)
public static func longitudeDecimalBand(_ longitude: Double) -> Double
- Get the longitude decimal band from the longitude
- @param longitude
-
longitude
- @return longitude decimal band
latitudeBand(_:)
public static func latitudeBand(_ latitude: Double) -> String
- Get the latitude band letters from the latitude
- @param latitude
-
latitude
- @return latitude band letters
latitudeBandValue(_:)
public static func latitudeBandValue(_ latitude: Double) -> Int
- Get the latitude band value from the latitude
- @param latitude
-
latitude
- @return latitude band value
latitudeDecimalBandValue(_:)
public static func latitudeDecimalBandValue(_ latitude: Double) -> Double
- Get the latitude decimal band value from the latitude
- @param latitude
-
latitude
- @return latitude decimal band value
bandValue(_:)
public static func bandValue(_ latitudeBand: String) -> Int
- Get the latitude band number equivalent to the longitude band (where AA
- is 1 and QZ is 360)
- @param latitudeBand
-
two character latitude band
- @return number band value
bandValue(_:)
public static func bandValue(_ latitudeBand: Character) -> Int
- Get the latitude character band number equivalent (where A is 1 and Z is
-
- @param latitudeBand
-
single character from latitude band
- @return number band value
bandLetters(_:)
public static func bandLetters(_ bandValue: Int) -> String
- Get the latitude band from the band number (where 1 is AA and 360 is QZ)
- @param bandValue
-
number band value
- @return two character latitude band
bandLetter(_:)
public static func bandLetter(_ bandValue: Int) -> Character
- Get the latitude character equivalent from the band number (where 1 is A
- and 24 is Z)
- @param bandValue
-
number band value
- @return single character of latitude band
quadrantColumn(_:)
public static func quadrantColumn(_ quadrant: Int) -> Int
- Get the quadrant southwest origin 0 indexed column
- @param quadrant
-
quadrant number
- @return 0 for quadrants 1|3, 1 for quadrants 2|4
quadrantRow(_:)
public static func quadrantRow(_ quadrant: Int) -> Int
- Get the quadrant southwest origin 0 indexed row
- @param quadrant
-
quadrant number
- @return 0 for quadrants 3|4, 1 for quadrants 1|2
keypadColumn(_:)
public static func keypadColumn(_ keypad: Int) -> Int
- Get the keypad southwest origin 0 indexed column
- @param keypad
-
keypad number
- @return 0 for keypads 1|4|7, 1 for keypads 2|5|8, 2 for keypads 3|6|9
keypadRow(_:)
public static func keypadRow(_ keypad: Int) -> Int
- Get the keypad southwest origin 0 indexed row
- @param keypad
-
keypad number
- @return 0 for keypads 7|8|9, 1 for keypads 4|5|6, 2 for keypads 1|2|3
quadrant(_:_:)
public static func quadrant(_ column: Int, _ row: Int) -> Int
- Get the quadrant from the southwest origin 0 indexed column and row
- @param column
-
0 indexed column
- @param row
-
0 indexed row
- @return quadrant
keypad(_:_:)
public static func keypad(_ column: Int, _ row: Int) -> Int
- Get the keypad from the southwest origin 0 indexed column and row
- @param column
-
0 indexed column
- @param row
-
0 indexed row
- @return keypad
gridRange(_:)
- Get a grid range from the bounds
- @param bounds
-
bounds
- @return grid range
bandNumberRange(_:)
public static func bandNumberRange(_ bounds: Bounds) -> BandNumberRange
- Get a band number range between the western and eastern bounds
- @param bounds
-
bounds
- @return band number range
bandNumberRange(_:_:)
public static func bandNumberRange(_ west: Double, _ east: Double) -> BandNumberRange
- Get a band number range between the western and eastern longitudes
- @param west
-
western longitude in degrees
- @param east
-
eastern longitude in degrees
- @return band number range
bandLettersRange(_:)
public static func bandLettersRange(_ bounds: Bounds) -> BandLettersRange
- Get a band letters range between the southern and northern bounds
- @param bounds
-
bounds
- @return band letters range
bandLettersRange(_:_:)
public static func bandLettersRange(_ south: Double, _ north: Double) -> BandLettersRange
- Get a band letters range between the southern and northern latitudes in
- degrees
- @param south
-
southern latitude in degrees
- @param north
-
northern latitude in degrees
- @return band letters range
degreeLabel(_:_:)
public static func degreeLabel(_ longitude: Double, _ latitude: Double) -> String
- Create a degree grid label
- @param longitude
-
longitude
- @param latitude
-
latitude
- @return degree label
nextPrecision(_:_:)
public static func nextPrecision(_ value: Double, _ precision: Double) -> Double
- Get the next precision value from the precision value and precision
- @param value
-
precision value
- @param precision
-
grid precision
- @return next precision value