mgrs-ios 1.1.6 Documentation

Class Grid​Point

public class GridPoint: SFPoint  
  • Point
GridPoint GridPoint SFPoint SFPoint GridPoint->SFPoint

Conforms To

SFPoint

Initializers

init(_:​_:​)

public convenience init(_ longitude: Double, _ latitude: Double)  
  • Initialize, in DEGREE units
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    

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

public init(_ longitude: Double, _ latitude: Double, _ unit: Unit)  
  • Initialize
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param unit
  •        unit
    

init(_:​)

public convenience init(_ point: GridPoint)  
  • Initialize
  • @param point
  •        point to copy
    

init(_:​_:​)

public init(_ point: SFPoint, _ unit: Unit)  
  • Initialize
  • @param point
  •        point to copy
    
  • @param unit
  •        unit
    

init?(coder:​)

public required init?(coder: NSCoder)  

Properties

unit

public var unit: Unit
  • Unit

longitude

public var longitude: Double  
  • The longitude

latitude

public var latitude: Double  
  • The latitude

hash

public override var hash: Int  

Methods

degrees(_:​_:​)

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

meters(_:​_:​)

public static func meters(_ longitude: Double, _ latitude: Double) -> GridPoint  
  • Create a point in meters
  • @param longitude
  •        longitude in meters
    
  • @param latitude
  •        latitude in meters
    
  • @return point in meters

to​Unit(_:​_:​_:​_:​)

public static func toUnit(_ fromUnit: Unit, _ longitude: Double, _ latitude: Double, _ toUnit: Unit) -> GridPoint  
  • Create a point from a coordinate in a unit to another unit
  • @param fromUnit
  •        unit of provided coordinate
    
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param toUnit
  •        desired unit
    
  • @return point in unit

to​Unit(_:​_:​_:​)

public static func toUnit(_ longitude: Double, _ latitude: Double, _ unit: Unit) -> GridPoint  
  • Create a point from a coordinate in an opposite unit to another unit
  • @param longitude
  •        longitude
    
  • @param latitude
  •        latitude
    
  • @param unit
  •        desired unit
    
  • @return point in unit

degrees​ToMeters(_:​_:​)

public static func degreesToMeters(_ longitude: Double, _ latitude: Double) -> GridPoint  
  • Create a point converting the degrees coordinate to meters
  • @param longitude
  •        longitude in degrees
    
  • @param latitude
  •        latitude in degrees
    
  • @return point in meters

meters​ToDegrees(_:​_:​)

public static func metersToDegrees(_ longitude: Double, _ latitude: Double) -> GridPoint  
  • Create a point converting the meters coordinate to degrees
  • @param longitude
  •        longitude in meters
    
  • @param latitude
  •        latitude in meters
    
  • @return point in degrees

is​Unit(_:​)

public func isUnit(_ unit: Unit) -> Bool  
  • Is in the provided unit type
  • @param unit
  •        unit
    
  • @return true if in the unit

is​Degrees()

public func isDegrees() -> Bool  
  • Is this point in degrees
  • @return true if degrees

is​Meters()

public func isMeters() -> Bool  
  • Is this point in meters
  • @return true if meters

to​Unit(_:​)

public func toUnit(_ unit: Unit) -> GridPoint  
  • Convert to the unit
  • @param unit
  •        unit
    
  • @return point in units, same point if equal units

to​Degrees()

public func toDegrees() -> GridPoint  
  • Convert to degrees
  • @return point in degrees, same point if already in degrees

to​Meters()

public func toMeters() -> GridPoint  
  • Convert to meters
  • @return point in meters, same point if already in meters

pixel(_:​)

public func pixel(_ tile: GridTile) -> Pixel  
  • Get the pixel where the point fits into tile
  • @param tile
  •        tile
    
  • @return pixel

pixel(_:​_:​_:​)

public func pixel(_ width: Int, _ height: Int, _ bounds: Bounds) -> Pixel  
  • Get the pixel where the point fits into the bounds
  • @param width
  •        width
    
  • @param height
  •        height
    
  • @param bounds
  •        bounds
    
  • @return pixel

to​Coordinate()

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

mutable​Copy(with:​)

public override func mutableCopy(with zone: NSZone? = nil) -> Any  

encode(with:​)

public override func encode(with coder: NSCoder)  

is​Equal(_:​)

public func isEqual(_ point: GridPoint?) -> Bool  

is​Equal(_:​)

public override func isEqual(_ object: Any?) -> Bool