From 35e548ef159f33f99fe0c941225cabd5439cc624 Mon Sep 17 00:00:00 2001 From: Alec Vulfson Date: Thu, 30 Jun 2016 14:46:49 -0400 Subject: [PATCH] Updating list of layers for Geonames --- helper/type_mapping.js | 3 ++- test/unit/sanitiser/_sources_and_layers.js | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/helper/type_mapping.js b/helper/type_mapping.js index ed20c0d86..59dbb5908 100644 --- a/helper/type_mapping.js +++ b/helper/type_mapping.js @@ -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'] diff --git a/test/unit/sanitiser/_sources_and_layers.js b/test/unit/sanitiser/_sources_and_layers.js index 96001f4e7..dfb997faf 100644 --- a/test/unit/sanitiser/_sources_and_layers.js +++ b/test/unit/sanitiser/_sources_and_layers.js @@ -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'] };