MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / parseWaypoints

Function parseWaypoints

test/nodejs/benchmark.js:10–18  ·  view source on GitHub ↗
(waypoints)

Source from the content-addressed store, hash-verified

8
9// Parse semicolon-separated waypoints from command line arguments
10function parseWaypoints(waypoints) {
11 if (waypoints == undefined) {
12 return undefined;
13 }
14 return waypoints.split(';').map((waypoint) => {
15 const [lon, lat] = waypoint.split(',');
16 return [parseFloat(lon), parseFloat(lat)];
17 });
18}
19const waypoints = parseWaypoints(args[1]) || [[7.41337, 43.72956],[7.41546, 43.73077]];
20const osrm = new OSRM({path, algorithm: 'MLD'});
21

Callers 1

benchmark.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected