Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ringsaturn/pk
Unofficial Placekey Go SDK
https://github.com/ringsaturn/pk
geocoding placekey uber-h3
Last synced: 2 months ago
JSON representation
Unofficial Placekey Go SDK
- Host: GitHub
- URL: https://github.com/ringsaturn/pk
- Owner: ringsaturn
- License: apache-2.0
- Created: 2022-02-01T10:06:57.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-14T00:22:57.000Z (3 months ago)
- Last Synced: 2024-08-14T02:33:10.941Z (3 months ago)
- Topics: geocoding, placekey, uber-h3
- Language: Go
- Homepage: https://pkg.go.dev/github.com/ringsaturn/pk
- Size: 77.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Placekey Go SDK [![Go Reference](https://pkg.go.dev/badge/github.com/ringsaturn/pk.svg)](https://pkg.go.dev/github.com/ringsaturn/pk)
## Install
```bash
go install github.com/ringsaturn/pk
```## Usage
```go
k, _ := pk.GeoToPlacekey(39.9289, 116.3883)
fmt.Println(k)
// Output: @6qk-v3d-brk
``````go
lat, long, _ := pk.PlacekeyToGeo("@6qk-v3d-brk")
fmt.Printf("%.3f %.3f \n", lat, long)
// Output: 39.929 116.388
```More usage examples:
## CLI usage
```bash
go install github.com/ringsaturn/pk/cmd/placekey@latest
````ToGeo`:
```bash
placekey ToGeo -pk "@627-wbz-tjv"
```Output:
```console
40.71237820442784 -74.0056425771711
````FromGeo`
```bash
placekey FromGeo -lat 40.71237820442784 -lng -74.0056425771711
```Output:
```console
@627-wbz-tjv
```## References
-
-
-
-
-