Skip to content

Commit

Permalink
Merge pull request #573 from pelias/update-gn-layers
Browse files Browse the repository at this point in the history
Updating list of layers for Geonames
  • Loading branch information
orangejulius committed Jun 30, 2016
2 parents ffbaffb + 35e548e commit 29a28e5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helper/type_mapping.js
Expand Up @@ -47,7 +47,8 @@ var SOURCE_MAPPING = addStandardTargetsToAliases(SOURCES, SOURCE_ALIASES);
var LAYERS_BY_SOURCE = {
openstreetmap: [ 'address', 'venue' ],
openaddresses: [ 'address' ],
geonames: [ 'country', 'region', 'county', 'locality', 'venue' ],
geonames: [ 'country','macroregion', 'region', 'county','localadmin',
'locality', 'neighbourhood', 'venue' ],
whosonfirst: [ 'continent', 'country', 'dependency', 'macroregion', 'region',
'locality', 'localadmin', 'macrocounty', 'county', 'macrohood', 'borough',
'neighbourhood', 'microhood', 'disputed']
Expand Down
11 changes: 11 additions & 0 deletions test/unit/sanitiser/_sources_and_layers.js
Expand Up @@ -51,6 +51,17 @@ module.exports.tests.no_errors = function(test, common) {
t.end();
});

test('valid combination', function(t) {
var raw = {};
var clean = { sources: ['geonames'], layers: ['macroregion'] };

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'] };
Expand Down

0 comments on commit 29a28e5

Please sign in to comment.