Browse Source

Add geoname type to most layers

The Geonames dataset includes lots of different kinds of places, so add
them to the mapping.
pull/292/head
Julian Simioni 9 years ago
parent
commit
fa44effdac
  1. 12
      helper/type_mapping.js
  2. 4
      test/unit/sanitiser/_layers.js

12
helper/type_mapping.js

@ -61,13 +61,13 @@ var SOURCE_TO_TYPE = {
*/
var LAYER_TO_TYPE = {
'venue': ['geoname','osmnode','osmway'],
'address': ['osmaddress','openaddresses'],
'country': ['admin0'],
'region': ['admin1'],
'county': ['admin2'],
'locality': ['locality'],
'address': ['osmaddress','openaddresses', 'geoname'],
'country': ['admin0', 'geoname'],
'region': ['admin1', 'geoname'],
'county': ['admin2', 'geoname'],
'locality': ['locality', 'geoname'],
'localadmin': ['local_admin'],
'neighbourhood': ['neighborhood']
'neighbourhood': ['neighborhood', 'geoname']
};
var LAYER_ALIASES = {

4
test/unit/sanitiser/_layers.js

@ -43,7 +43,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.end();
});
test('address (alias) layer', function(t) {
var address_layers = ['osmaddress','openaddresses'];
var address_layers = ['osmaddress','openaddresses','geoname'];
var raw = { layers: 'address' };
var clean = {};
@ -76,7 +76,7 @@ module.exports.tests.sanitize_layers = function(test, common) {
t.end();
});
test('address alias layer plus regular layers', function(t) {
var address_layers = ['osmaddress','openaddresses'];
var address_layers = ['osmaddress','openaddresses','geoname'];
var reg_layers = ['admin0', 'locality'];
var raw = { layers: 'address,country,locality' };

Loading…
Cancel
Save