GeoHex3.swift 0.3.0

GeoHex3.swift 0.3.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release May 2021
SPMSupports SPM

Maintained by nekowen.



  • By
  • nekowen

GeoHex3.swift

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 8.0+
  • Xcode 11.0+
  • Swift 5.0+

If you want to use Swift3, Please use 0.1.x version.

Installation

GeoHex3.swift is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "GeoHex3.swift"

Usage

To get Hex Area from the coordinate, call the "getZone" method of the GeoHex3 class.

import GeoHex3Swift

let zone = GeoHex3.getZone(coordinate: COORDINATE, level: 7)
let hexcode = zone.code

Also, if the SouthWest and NorthEast coordinates are known, you can get the multiple areas it in range.

let zones = GeoHex3.getZone(southWest: SOUTHWEST_COORD, northEast: NORTHEAST_COORD, level: 7, buffer: false)

let areaHexcodes = zones.map { $0.code }
let areaPolygons = zones.map { $0.polygon }

Author

nekowen, [email protected]

License

GeoHex3.swift is available under the MIT license. See the LICENSE file for more info.

Algorithm License

Copyright (c) 2009 @sa2da (http://twitter.com/sa2da)

GeoHex v3 http://geogames.net/geohex/v3