Browse Source

Merge pull request #673 from pelias/master

Merge master into staging
pull/682/head
Julian Simioni 8 years ago committed by GitHub
parent
commit
aad5765978
  1. 6
      helper/type_mapping.js
  2. 11
      test/unit/sanitiser/_sources_and_layers.js

6
helper/type_mapping.js

@ -51,7 +51,7 @@ var LAYERS_BY_SOURCE = {
'locality','borough', 'neighbourhood', 'venue' ],
whosonfirst: [ 'continent', 'country', 'dependency', 'macroregion', 'region',
'locality', 'localadmin', 'macrocounty', 'county', 'macrohood', 'borough',
'neighbourhood', 'microhood', 'disputed']
'neighbourhood', 'microhood', 'disputed', 'venue']
};
/*
@ -60,7 +60,9 @@ var LAYERS_BY_SOURCE = {
* may have layers that mean the same thing but have a different name
*/
var LAYER_ALIASES = {
'coarse': LAYERS_BY_SOURCE.whosonfirst
'coarse': [ 'continent', 'country', 'dependency', 'macroregion', 'region',
'locality', 'localadmin', 'macrocounty', 'county', 'macrohood', 'borough',
'neighbourhood', 'microhood', 'disputed']
};
// create a list of all layers by combining each entry from LAYERS_BY_SOURCE

11
test/unit/sanitiser/_sources_and_layers.js

@ -73,6 +73,17 @@ test('valid combination', function(t) {
t.end();
});
test('valid combination: wof venues', function(t) {
var raw = {};
var clean = { sources: ['whosonfirst'], layers: ['venue'] };
var messages = sanitize(raw, clean);
t.equal(messages.errors.length, 0, 'should return no errors');
t.equal(messages.warnings.length, 0, 'should return no warnings');
t.end();
});
test('valid combination because of multiple sources', function(t) {
var raw = {};
var clean = { sources: ['openstreetmap', 'openaddresses'], layers: ['venue'] };

Loading…
Cancel
Save