Browse Source

added support for `macroregion`

pull/505/head
Stephen Hess 9 years ago
parent
commit
c99fa9f0ef
  1. 2
      helper/type_mapping.js
  2. 1
      test/ciao/autocomplete/layers_alias_coarse.coffee
  3. 2
      test/ciao/autocomplete/layers_invalid.coffee
  4. 2
      test/ciao/autocomplete/layers_mix_invalid_valid.coffee
  5. 3
      test/ciao/reverse/layers_alias_coarse.coffee
  6. 2
      test/ciao/reverse/layers_invalid.coffee
  7. 2
      test/ciao/reverse/layers_mix_invalid_valid.coffee
  8. 1
      test/ciao/search/layers_alias_coarse.coffee
  9. 2
      test/ciao/search/layers_invalid.coffee
  10. 2
      test/ciao/search/layers_mix_invalid_valid.coffee
  11. 2
      test/unit/helper/type_mapping.js
  12. 6
      test/unit/sanitiser/_layers.js

2
helper/type_mapping.js

@ -48,7 +48,7 @@ var LAYERS_BY_SOURCE = {
openstreetmap: [ 'address', 'venue' ],
openaddresses: [ 'address' ],
geonames: [ 'country', 'region', 'county', 'locality', 'venue' ],
whosonfirst: [ 'continent', 'country', 'dependency', 'region',
whosonfirst: [ 'continent', 'country', 'dependency', 'macroregion', 'region',
'locality', 'localadmin', 'macrocounty', 'county', 'macrohood', 'neighbourhood', 'microhood', 'disputed']
};

1
test/ciao/autocomplete/layers_alias_coarse.coffee

@ -34,6 +34,7 @@ json.geocoding.query['size'].should.eql 10
json.geocoding.query.layers.should.eql [ "continent",
"country",
"dependency",
"macroregion",
"region",
"locality",
"localadmin",

2
test/ciao/autocomplete/layers_invalid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors
should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
#? expected warnings
should.not.exist json.geocoding.warnings

2
test/ciao/autocomplete/layers_mix_invalid_valid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors
should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
#? expected warnings
should.not.exist json.geocoding.warnings

3
test/ciao/reverse/layers_alias_coarse.coffee

@ -31,12 +31,13 @@ should.not.exist json.geocoding.warnings
#? inputs
json.geocoding.query['size'].should.eql 10
json.geocoding.query.layers.should.eql [ "continent",
"macrocounty",
"country",
"dependency",
"macroregion",
"region",
"locality",
"localadmin",
"macrocounty",
"county",
"macrohood",
"neighbourhood",

2
test/ciao/reverse/layers_invalid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors
should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
#? expected warnings
should.not.exist json.geocoding.warnings

2
test/ciao/reverse/layers_mix_invalid_valid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors
should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
#? expected warnings
should.not.exist json.geocoding.warnings

1
test/ciao/search/layers_alias_coarse.coffee

@ -34,6 +34,7 @@ json.geocoding.query['size'].should.eql 10
json.geocoding.query.layers.should.eql [ "continent",
"country",
"dependency",
"macroregion",
"region",
"locality",
"localadmin",

2
test/ciao/search/layers_invalid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors
should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
#? expected warnings
should.not.exist json.geocoding.warnings

2
test/ciao/search/layers_mix_invalid_valid.coffee

@ -24,7 +24,7 @@ json.features.should.be.instanceof Array
#? expected errors
should.exist json.geocoding.errors
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,locality,continent,macrocounty,dependency,localadmin,macrohood,neighbourhood,microhood,disputed' ]
#? expected warnings
should.not.exist json.geocoding.warnings

2
test/unit/helper/type_mapping.js

@ -12,7 +12,7 @@ module.exports.tests.interfaces = function(test, common) {
test('alias layer mapping', function(t) {
t.deepEquals(type_mapping.layer_mapping.coarse,
[ 'continent', 'country', 'dependency',
[ 'continent', 'country', 'dependency', 'macroregion',
'region', 'locality', 'localadmin', 'macrocounty', 'county', 'macrohood',
'neighbourhood', 'microhood', 'disputed' ]);
t.end();

6
test/unit/sanitiser/_layers.js

@ -42,7 +42,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
sanitize(raw, clean);
var admin_layers = [ 'continent', 'country', 'dependency',
'region', 'locality', 'localadmin', 'macrocounty', 'county', 'macrohood', 'neighbourhood',
'macroregion', 'region', 'locality', 'localadmin', 'macrocounty', 'county', 'macrohood', 'neighbourhood',
'microhood', 'disputed' ];
t.deepEqual(clean.layers, admin_layers, 'coarse layers set');
@ -77,7 +77,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
sanitize(raw, clean);
var expected_layers = [ 'continent', 'country', 'dependency',
'region', 'locality', 'localadmin', 'macrocounty', 'county', 'macrohood', 'neighbourhood',
'macroregion', 'region', 'locality', 'localadmin', 'macrocounty', 'county', 'macrohood', 'neighbourhood',
'microhood', 'disputed' ];
t.deepEqual(clean.layers, expected_layers, 'coarse + regular layers set');
@ -113,7 +113,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
sanitize(raw, clean);
var coarse_layers = [ 'continent',
'country', 'dependency', 'region', 'locality', 'localadmin',
'country', 'dependency', 'macroregion', 'region', 'locality', 'localadmin',
'macrocounty', 'county', 'macrohood', 'neighbourhood', 'microhood',
'disputed' ];

Loading…
Cancel
Save