Skip to content

Commit

Permalink
fix(r5): workaround issue with segments being processed multiple times.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwigway committed Nov 9, 2016
1 parent a2d4644 commit 17c6e7f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/plan/r5-to-otp.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@ function formatPortion (option, portion) {
}

function formatStreetEdge (streetEdge) {
const line = polyline.decode(streetEdge.geometryPolyline)
streetEdge.geometry = {
points: streetEdge.geometryPolyline,
length: line.length
if (streetEdge.geometry === undefined) {
const line = polyline.decode(streetEdge.geometryPolyline)
streetEdge.geometry = {
points: streetEdge.geometryPolyline,
length: line.length
}
delete streetEdge.geometryPolyline
streetEdge.distance = streetEdge.distance / 1000 // to meters
}
delete streetEdge.geometryPolyline
streetEdge.distance = streetEdge.distance / 1000 // to meters
return streetEdge
}

0 comments on commit 17c6e7f

Please sign in to comment.