From 908100d9c50e19387a09c053a1dc71610b7522a1 Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Wed, 24 Aug 2016 17:47:02 -0400 Subject: [PATCH 1/2] Explicitly set coarse alias rather than using WOF layers Who's on First will have more than just coarse data now! --- helper/type_mapping.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helper/type_mapping.js b/helper/type_mapping.js index fde1fab1..8da5682c 100644 --- a/helper/type_mapping.js +++ b/helper/type_mapping.js @@ -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 From b0c0a5fe5cc541585d576186ce4f63038d462def Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Wed, 24 Aug 2016 17:48:16 -0400 Subject: [PATCH 2/2] Add venues to Who's on First --- helper/type_mapping.js | 2 +- test/unit/sanitiser/_sources_and_layers.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/helper/type_mapping.js b/helper/type_mapping.js index 8da5682c..0d51ef81 100644 --- a/helper/type_mapping.js +++ b/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'] }; /* diff --git a/test/unit/sanitiser/_sources_and_layers.js b/test/unit/sanitiser/_sources_and_layers.js index b943770c..5b8bf3a2 100644 --- a/test/unit/sanitiser/_sources_and_layers.js +++ b/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'] };