Skip to content

Instantly share code, notes, and snippets.

@ghiermann
ghiermann / PolylineUtils.kt
Created August 23, 2016 08:20
Kotlin PolylineUtils - encoding/decoding of polylines, simplification with Ramer-Douglas–Peucker algorithm
data class Coordinate(val longitude: Double, val latitude: Double)
/**
* Encodes a polyline using Google's polyline algorithm
* (See http://code.google.com/apis/maps/documentation/polylinealgorithm.html for more information).
*
* code derived from : https://gist.github.com/signed0/2031157
*
* @param (x,y)-Coordinates