Popularity
2.4
Growing
Activity
3.1
Declining
36
3
5

Description

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

See https://godoc.org/github.com/twpayne/go-polyline.

Encoding example:

Programming language: Go
Tags: GIS     Geospatial     Google Maps    

polyline alternatives and similar packages

Based on the "GIS" category

Do you think we are missing an alternative of polyline or a related project?

Add another 'GIS' Package

README

go-polyline

Build Status GoDoc Report Card Coverage Status

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

Encoding example

func ExampleEncodeCoords() {
    var coords = [][]float64{
        {38.5, -120.2},
        {40.7, -120.95},
        {43.252, -126.453},
    }
    fmt.Printf("%s\n", EncodeCoords(coords))
    // Output: _p~iF~ps|U_ulLnnqC_mqNvxq`@
}

Decoding example

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

License

BSD-2-Clause


*Note that all licence references and agreements mentioned in the polyline README section above are relevant to that project's source code only.