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:
committed by
Patrick Niklaus
parent
0f2bb5dde5
commit
fa525ad610
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user