Skip to content

Instantly share code, notes, and snippets.

@giraldeau
Created November 14, 2015 05:42
Show Gist options
  • Save giraldeau/89fa5b25c32092e2ce62 to your computer and use it in GitHub Desktop.
Save giraldeau/89fa5b25c32092e2ce62 to your computer and use it in GitHub Desktop.
console.log("loading...")
var OSRM = require('osrm');
var osrm = new OSRM("geofabrik/canada-latest.osrm");
console.log("begin")
var coord = [];
coord.push([45.5370569, -73.5708777]);
coord.push([46.0243857, -73.439845]);
var query = {
coordinates: coord,
alternateRoute: false,
};
osrm.route(query, function(err, result) {
if (err)
console.log("error: " + err);
console.log("ok: " + JSON.stringify(result, null, 4));
});
console.log("done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment