Skip to content
/ Ch3 Public

A small Swift package exposing H3 to Swift.

License

Notifications You must be signed in to change notification settings

bdotdub/Ch3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ch3

A small Swift package that exposes the H3 to Swift. SwiftH3 is probably what you want to use. This library works directly with the C functions, whereas SwiftH3 is more idiomatic Swift.

Example

# Create coordinate and get the H3 index
var coord = GeoCoord(lat: degsToRads(40.661), lon: degsToRads(-73.944))
let index = geoToH3(&coord, 10)

# Get the string representation of the index
let cString = strdup("")
h3ToString(self, cString, 17)
print("\(String(cString: cString!))")

Thanks to @s1ddok for his Cpng repo, from which I used to figure out how to build this repo.

About

A small Swift package exposing H3 to Swift.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages