Return an array with meta-data for each coordinate.

Currently supports duration and distance for each coordinate.

This is particularly useful in map-matching, comparing how
a trip progresses compared to a real GPS trace that is
map-matched.
This commit is contained in:
Daniel Patterson
2016-05-08 22:58:13 -07:00
committed by Patrick Niklaus
parent 0f2bb5dde5
commit fa525ad610
13 changed files with 121 additions and 10 deletions
+10
View File
@@ -141,6 +141,16 @@ module.exports = function () {
return this.extractInstructionList(instructions, s => s.maneuver.bearing_after);
};
this.annotationList = (instructions) => {
// Pull out all the distinct segment distances, skipping the arrive
// instructions, and the leading 0 on all timestamps arrays.
var pairs = [];
for (var i in instructions.annotation.duration) {
pairs.push(instructions.annotation.duration[i]+":"+instructions.annotation.distance[i]);
}
return pairs.join(",");
};
this.turnList = (instructions) => {
return instructions.legs.reduce((m, v) => m.concat(v.steps), [])
.map(v => {