Remove all core-CH left-overs (#6920)
* Remove all core-CH left-overs * Fix formatting * Update CHANGELOG.md
This commit is contained in:
+2
-15
@@ -14,20 +14,16 @@ PROFILE:=$(PROFILE_ROOT)/car.lua
|
||||
|
||||
all: data
|
||||
|
||||
data: ch/$(DATA_NAME).osrm.hsgr corech/$(DATA_NAME).osrm.hsgr mld/$(DATA_NAME).osrm.partition
|
||||
data: ch/$(DATA_NAME).osrm.hsgr mld/$(DATA_NAME).osrm.partition
|
||||
|
||||
clean:
|
||||
-rm -r $(DATA_NAME).*
|
||||
-rm -r ch corech mld
|
||||
-rm -r ch mld
|
||||
|
||||
ch/$(DATA_NAME).osrm: $(DATA_NAME).osrm
|
||||
mkdir -p ch
|
||||
cp $(DATA_NAME).osrm.* ch/
|
||||
|
||||
corech/$(DATA_NAME).osrm: $(DATA_NAME).osrm
|
||||
mkdir -p corech
|
||||
cp $(DATA_NAME).osrm.* corech/
|
||||
|
||||
mld/$(DATA_NAME).osrm: $(DATA_NAME).osrm
|
||||
mkdir -p mld
|
||||
cp $(DATA_NAME).osrm.* mld/
|
||||
@@ -42,10 +38,6 @@ ch/$(DATA_NAME).osrm.hsgr: ch/$(DATA_NAME).osrm $(PROFILE) $(OSRM_CONTRACT)
|
||||
@echo "Running osrm-contract..."
|
||||
$(TIMER) "osrm-contract\t$@" $(OSRM_CONTRACT) $<
|
||||
|
||||
corech/$(DATA_NAME).osrm.hsgr: corech/$(DATA_NAME).osrm $(PROFILE) $(OSRM_CONTRACT)
|
||||
@echo "Running osrm-contract..."
|
||||
$(TIMER) "osrm-contract\t$@" $(OSRM_CONTRACT) --core=0.5 $<
|
||||
|
||||
mld/$(DATA_NAME).osrm.partition: mld/$(DATA_NAME).osrm $(PROFILE) $(OSRM_PARTITION)
|
||||
@echo "Running osrm-partition..."
|
||||
$(TIMER) "osrm-partition\t$@" $(OSRM_PARTITION) $<
|
||||
@@ -61,11 +53,6 @@ benchmark: data $(DATA_NAME).requests
|
||||
$(TIMER) "queries\tCH" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
|
||||
@cat osrm-routed.pid | xargs kill
|
||||
@rm osrm-routed.pid
|
||||
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=CoreCH corech/$(DATA_NAME).osrm > /dev/null & echo "$$!" > osrm-routed.pid'
|
||||
@sleep 1
|
||||
$(TIMER) "queries\tCoreCH" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
|
||||
@cat osrm-routed.pid | xargs kill
|
||||
@rm osrm-routed.pid
|
||||
@/bin/sh -c '$(OSRM_ROUTED) --algorithm=MLD mld/$(DATA_NAME).osrm > /dev/null & echo "$$!" > osrm-routed.pid'
|
||||
@sleep 1
|
||||
$(TIMER) "queries\tMLD" "cat $(DATA_NAME).requests | xargs curl &> /dev/null"
|
||||
|
||||
@@ -16,12 +16,10 @@ exports.test_tile = {'at': [17059, 11948, 15], 'size': 159125};
|
||||
if (process.env.OSRM_DATA_PATH !== undefined) {
|
||||
exports.data_path = path.join(path.resolve(process.env.OSRM_DATA_PATH), "ch/monaco.osrm");
|
||||
exports.mld_data_path = path.join(path.resolve(process.env.OSRM_DATA_PATH), "mld/monaco.osrm");
|
||||
exports.corech_data_path = path.join(path.resolve(process.env.OSRM_DATA_PATH), "corech/monaco.osrm");
|
||||
exports.test_memory_path = path.join(path.resolve(process.env.OSRM_DATA_PATH), "test_memory");
|
||||
console.log('Setting custom data path to ' + exports.data_path);
|
||||
} else {
|
||||
exports.data_path = path.resolve(path.join(__dirname, "../data/ch/monaco.osrm"));
|
||||
exports.mld_data_path = path.resolve(path.join(__dirname, "../data/mld/monaco.osrm"));
|
||||
exports.corech_data_path = path.resolve(path.join(__dirname, "../data/corech/monaco.osrm"));
|
||||
exports.test_memory_path = path.resolve(path.join(__dirname, "../data/test_memory"));
|
||||
}
|
||||
|
||||
+3
-18
@@ -3,7 +3,6 @@ var test = require('tape');
|
||||
var monaco_path = require('./constants').data_path;
|
||||
var test_memory_file = require('./constants').test_memory_file;
|
||||
var monaco_mld_path = require('./constants').mld_data_path;
|
||||
var monaco_corech_path = require('./constants').corech_data_path;
|
||||
|
||||
test('constructor: throws if new keyword is not used', function(assert) {
|
||||
assert.plan(1);
|
||||
@@ -65,13 +64,13 @@ test('constructor: throws if given a non-string/obj argument', function(assert)
|
||||
test('constructor: throws if given an unkown algorithm', function(assert) {
|
||||
assert.plan(1);
|
||||
assert.throws(function() { new OSRM({algorithm: 'Foo', shared_memory: true}); },
|
||||
/algorithm option must be one of 'CH', 'CoreCH', or 'MLD'/);
|
||||
/algorithm option must be one of 'CH', or 'MLD'/);
|
||||
});
|
||||
|
||||
test('constructor: throws if given an invalid algorithm', function(assert) {
|
||||
assert.plan(1);
|
||||
assert.throws(function() { new OSRM({algorithm: 3, shared_memory: true}); },
|
||||
/algorithm option must be a string and one of 'CH', 'CoreCH', or 'MLD'/);
|
||||
/algorithm option must be a string and one of 'CH', or 'MLD'/);
|
||||
});
|
||||
|
||||
test('constructor: loads MLD if given as algorithm', function(assert) {
|
||||
@@ -86,22 +85,8 @@ test('constructor: loads CH if given as algorithm', function(assert) {
|
||||
assert.ok(osrm);
|
||||
});
|
||||
|
||||
test('constructor: loads CoreCH if given as algorithm', function(assert) {
|
||||
assert.plan(1);
|
||||
var osrm = new OSRM({algorithm: 'CoreCH', path: monaco_corech_path});
|
||||
assert.ok(osrm);
|
||||
});
|
||||
|
||||
test('constructor: autoswitches to CoreCH for a CH dataset if capable', function(assert) {
|
||||
assert.plan(1);
|
||||
var osrm = new OSRM({algorithm: 'CH', path: monaco_corech_path});
|
||||
assert.ok(osrm);
|
||||
});
|
||||
|
||||
test('constructor: throws if data doesn\'t match algorithm', function(assert) {
|
||||
assert.plan(3);
|
||||
assert.throws(function() { new OSRM({algorithm: 'CoreCH', path: monaco_mld_path}); }, /Could not find any metrics for CH/, 'CoreCH with MLD data');
|
||||
assert.ok(new OSRM({algorithm: 'CoreCH', path: monaco_path}), 'CoreCH with CH data');
|
||||
assert.plan(1);
|
||||
assert.throws(function() { new OSRM({algorithm: 'MLD', path: monaco_path}); }, /Could not find any metrics for MLD/, 'MLD with CH data');
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ var OSRM = require('../../');
|
||||
var test = require('tape');
|
||||
var monaco_path = require('./constants').data_path;
|
||||
var monaco_mld_path = require('./constants').mld_data_path;
|
||||
var monaco_corech_path = require('./constants').corech_data_path;
|
||||
var three_test_coordinates = require('./constants').three_test_coordinates;
|
||||
var two_test_coordinates = require('./constants').two_test_coordinates;
|
||||
const flatbuffers = require('../../features/support/flatbuffers').flatbuffers;
|
||||
@@ -76,32 +75,6 @@ test('route: routes Monaco on MLD', function(assert) {
|
||||
});
|
||||
});
|
||||
|
||||
test('route: routes Monaco on CoreCH', function(assert) {
|
||||
assert.plan(5);
|
||||
var osrm = new OSRM({path: monaco_corech_path, algorithm: 'CoreCH'});
|
||||
osrm.route({coordinates: [[13.43864,52.51993],[13.415852,52.513191]]}, function(err, route) {
|
||||
assert.ifError(err);
|
||||
assert.ok(route.waypoints);
|
||||
assert.ok(route.routes);
|
||||
assert.ok(route.routes.length);
|
||||
assert.ok(route.routes[0].geometry);
|
||||
});
|
||||
});
|
||||
|
||||
test('route: routes Monaco and returns a JSON buffer', function(assert) {
|
||||
assert.plan(6);
|
||||
var osrm = new OSRM({path: monaco_corech_path, algorithm: 'CoreCH'});
|
||||
osrm.route({coordinates: [[13.43864,52.51993],[13.415852,52.513191]]}, { format: 'json_buffer'}, function(err, result) {
|
||||
assert.ifError(err);
|
||||
assert.ok(result instanceof Buffer);
|
||||
const route = JSON.parse(result);
|
||||
assert.ok(route.waypoints);
|
||||
assert.ok(route.routes);
|
||||
assert.ok(route.routes.length);
|
||||
assert.ok(route.routes[0].geometry);
|
||||
});
|
||||
});
|
||||
|
||||
test('route: throws with too few or invalid args', function(assert) {
|
||||
assert.plan(4);
|
||||
var osrm = new OSRM(monaco_path);
|
||||
|
||||
Reference in New Issue
Block a user