initial commit

This commit is contained in:
2023-03-27 20:57:28 +02:00
commit fb30573934
29 changed files with 18303 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
package polylines
import (
"github.com/paulmach/orb"
"github.com/twpayne/go-polyline"
)
func Encode(line orb.LineString) string {
preparedLine := [][]float64{}
for _, point := range line {
preparedLine = append(preparedLine, []float64{point.Lon(), point.Lat()})
}
return string(polyline.EncodeCoords(preparedLine))
}