Home
Softono

Go Polyline

Open source BSD-2-Clause Go
122
Stars
27
Forks
0
Issues
4
Watchers
5 months
Last Commit

 About Go Polyline

Package polyline implements a Google Maps Encoding Polyline encoder and decoder.

Platforms

Web Self-hosted

Languages

Go

Links

Need Help Installing Go Polyline?

We provide expert installation service for this software. Our team will install, configure, and secure Go Polyline on your server. plans start at just $30.

Go Polyline

View on GitHub

go-polyline

Build Status PkgGoDev Coverage Status

Package polyline implements a Google Maps Encoding Polyline encoder and decoder.

Encoding example

func ExampleEncodeCoords() {
	coords := [][]float64{
		{38.5, -120.2},
		{40.7, -120.95},
		{43.252, -126.453},
	}
	fmt.Println(string(polyline.EncodeCoords(coords)))
	// Output: _p~iF~ps|U_ulLnnqC_mqNvxq`@
}

Decoding example

func ExampleDecodeCoords() {
	buf := []byte("_p~iF~ps|U_ulLnnqC_mqNvxq`@")
	coords, _, _ := polyline.DecodeCoords(buf)
	fmt.Println(coords)
	// Output: [[38.5 -120.2] [40.7 -120.95] [43.252 -126.453]]
}

License

BSD-2-Clause