Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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

-
-
-
-
-