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B`AhDh@rBt@~Cf@bCf@hC\\rBb@rC^pC^dD\\~CXpDVjEVlGLlFDlC@hC@lCApGA|@EfGKdGWjPMrJC~FCpC?nAMtBAHEVKZMRURWHa@@KCOKQWO]Ik@Gq@IyB@Y@c@Ao@jCU~@IXCbAIxCWrAKdBQRCnCU\\Cn@ApAJz@Rl@Nb@Pb@RR{@HWFKLMHEJ?H@D@B?n@HZDF@F@NwC?GFaBx@QhCu@DAf@Od@KLA\\Gr@KZENBbC]~FcCJdA'

Test runner

Ready to run.

Testing in
TestOps/sec
Decode iteratively
function decodePath(encodedPath){
  const len = encodedPath.length;
  let index = 0;
  const array = [];
  let lat = 0;
  let lng = 0;
  const deltas = []
  while (index < len) {
    let b;
    let shift = 0;
    let result = 0;
    do {
      b = encodedPath.charCodeAt(index++) - 63;
      result |= (b & 0x1f) << shift;
      shift += 5;
    } while (b >= 0x20);
    const deltaLat = ((result & 1) ? ~(result >> 1) : (result >> 1))
    lat += deltaLat;
    deltas.push(deltaLat)
    shift = 0;
    result = 0;
    do {
      b = encodedPath.charCodeAt(index++) - 63;
      result |= (b & 0x1f) << shift;
      shift += 5;
    } while (b >= 0x20);
    const deltaLon = ((result & 1) ? ~(result >> 1) : (result >> 1))
    lng += deltaLon;
    deltas.push(deltaLon)
    array.push([lat * 1e-5, lng * 1e-5]);
  }
  console.log(deltas)
  return array;
}
decodePath(polyline)
ready
Decode with js generator
function decodePolyline(encodedPath){
  return [...latLagPairs(encodedPath)]
}
function* latLagPairs(encodedPath){
  const deltaGen = deltaGenerator(encodedPath)
  let current = deltaGen.next()
  let longitude = 0;
  let latitude = 0;
  while(!current.done){
    longitude += current.value;
    current = deltaGen.next()
    latitude += current.value
    current = deltaGen.next()
    yield [longitude*1e-5, latitude*1e-5]
  }
}
function* deltaGenerator(encodedPath){
  const len = encodedPath.length;
  let index = 0;
  while (index <len){
    let shift = 0;
    let result = 0;
    let b;
    do {
      b = encodedPath.charCodeAt(index++) - 63;
      result |= (b & 0x1f) << shift;
      shift += 5;
    } while (b >= 0x20);
    const delta = ((result & 1) ? ~(result >> 1) : (result >> 1))
    yield delta
  }
}
decodePolyline(polyline)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.