Use VALHALLA_HOME to find valhalla tools. Disable heirarchy calculation to speed up pre-processing.
This commit is contained in:
parent
a9cbb270fb
commit
3f2d0afcac
@ -105,7 +105,7 @@ class ValhallaDirectLoader extends OSRMBaseLoader {
|
|||||||
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
if (this.osrmIsRunning()) return callback(new Error("osrm-routed already running!"));
|
||||||
|
|
||||||
var args = [this.inputFile, '1'];
|
var args = [this.inputFile, '1'];
|
||||||
this.child = child_process.execFile('/Users/danpat/mapbox/valhalla/valhalla_service', args, this.scope.environment, (err) => {
|
this.child = child_process.execFile(`${process.env.VALHALLA_HOME}/valhalla_service`, args, this.scope.environment, (err) => {
|
||||||
if (err && err.signal !== 'SIGINT') {
|
if (err && err.signal !== 'SIGINT') {
|
||||||
this.child = null;
|
this.child = null;
|
||||||
throw new Error(util.format('valhalla_service %s: %s', errorReason(err), err.cmd));
|
throw new Error(util.format('valhalla_service %s: %s', errorReason(err), err.cmd));
|
||||||
|
|||||||
@ -265,9 +265,12 @@ module.exports = function () {
|
|||||||
`--mjolnir-timezone`, `${p.inputCacheDir}/${p.scenarioID}_valhalla_tiles/timezones.sqlite`,
|
`--mjolnir-timezone`, `${p.inputCacheDir}/${p.scenarioID}_valhalla_tiles/timezones.sqlite`,
|
||||||
`--mjolnir-admin`, `${p.inputCacheDir}/${p.scenarioID}_valhalla_tiles/admins.sqlite`];
|
`--mjolnir-admin`, `${p.inputCacheDir}/${p.scenarioID}_valhalla_tiles/admins.sqlite`];
|
||||||
|
|
||||||
child_process.execFile('/Users/danpat/mapbox/valhalla/scripts/valhalla_build_config', params, {}, (error, stdout, stderr) => {
|
child_process.execFile(`${process.env.VALHALLA_HOME}/scripts/valhalla_build_config`, params, {}, (error, stdout, stderr) => {
|
||||||
if (error) { throw error; }
|
if (error) { throw error; }
|
||||||
fs.writeFile(`${p.inputCacheDir}/${p.scenarioID}_valhalla_config.json`, stdout, (err) => {
|
// Disable heirarchy calculation - it's slow, and not needed for small tests.
|
||||||
|
var config = JSON.parse(stdout);
|
||||||
|
config.mjolnir.hierarchy = false;
|
||||||
|
fs.writeFile(`${p.inputCacheDir}/${p.scenarioID}_valhalla_config.json`, JSON.stringify(config), (err) => {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
fs.writeFile(stamp, 'ok', callback);
|
fs.writeFile(stamp, 'ok', callback);
|
||||||
})
|
})
|
||||||
@ -283,7 +286,7 @@ module.exports = function () {
|
|||||||
var params = [`-c`,`${p.inputCacheDir}/${p.scenarioID}_valhalla_config.json`,
|
var params = [`-c`,`${p.inputCacheDir}/${p.scenarioID}_valhalla_config.json`,
|
||||||
`${p.inputCacheFilePBF}`];
|
`${p.inputCacheFilePBF}`];
|
||||||
|
|
||||||
child_process.execFile('/Users/danpat/mapbox/valhalla/valhalla_build_tiles', params, {}, (error, stdout, stderr) => {
|
child_process.execFile(`${process.env.VALHALLA_HOME}/valhalla_build_tiles`, params, {}, (error, stdout, stderr) => {
|
||||||
if (error) { throw error; }
|
if (error) { throw error; }
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
console.log(stderr);
|
console.log(stderr);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user