Polyline encoder / decoder in swift