Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 1.03 KB

README.md

File metadata and controls

61 lines (43 loc) · 1.03 KB

Placekey Go SDK Go Reference

Install

go install github.com/ringsaturn/pk

Usage

k, _ := pk.GeoToPlacekey(39.9289, 116.3883)
fmt.Println(k)
// Output: @6qk-v3d-brk
lat, long, _ := pk.PlacekeyToGeo("@6qk-v3d-brk")
fmt.Printf("%.3f %.3f \n", lat, long)
// Output: 39.929 116.388

More usage examples: https://pkg.go.dev/github.com/ringsaturn/pk#pkg-examples

CLI usage

go install github.com/ringsaturn/pk/cmd/placekey@latest

ToGeo:

placekey ToGeo -pk "@627-wbz-tjv"

Output:

40.71237820442784 -74.0056425771711

FromGeo

placekey FromGeo -lat 40.71237820442784 -lng -74.0056425771711

Output:

@627-wbz-tjv

References