gars-ios 1.1.5 Documentation

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

longitude​Band(_:​)

public static func longitudeBand(_ longitude: Double) -> Int  
  • Get the longitude band from the longitude
  • @param longitude
  •        longitude
    
  • @return longitude band

longitude​Decimal​Band(_:​)

public static func longitudeDecimalBand(_ longitude: Double) -> Double  
  • Get the longitude decimal band from the longitude
  • @param longitude
  •        longitude
    
  • @return longitude decimal band

latitude​Band(_:​)

public static func latitudeBand(_ latitude: Double) -> String  
  • Get the latitude band letters from the latitude
  • @param latitude
  •        latitude
    
  • @return latitude band letters

latitude​Band​Value(_:​)

public static func latitudeBandValue(_ latitude: Double) -> Int  
  • Get the latitude band value from the latitude
  • @param latitude
  •        latitude
    
  • @return latitude band value

latitude​Decimal​Band​Value(_:​)

public static func latitudeDecimalBandValue(_ latitude: Double) -> Double  
  • Get the latitude decimal band value from the latitude
  • @param latitude
  •        latitude
    
  • @return latitude decimal band value

band​Value(_:​)

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

band​Value(_:​)

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

band​Letters(_:​)

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

band​Letter(_:​)

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

quadrant​Column(_:​)

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

quadrant​Row(_:​)

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

keypad​Column(_:​)

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

keypad​Row(_:​)

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

grid​Range(_:​)

public static func gridRange(_ bounds: Bounds) -> GridRange  
  • Get a grid range from the bounds
  • @param bounds
  •        bounds
    
  • @return grid range

band​Number​Range(_:​)

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

band​Number​Range(_:​_:​)

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

band​Letters​Range(_:​)

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

band​Letters​Range(_:​_:​)

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

degree​Label(_:​_:​)

public static func degreeLabel(_ longitude: Double, _ latitude: Double) -> String  
  • Create a degree grid label
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @return degree label

next​Precision(_:​_:​)

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