]> git.openstreetmap.org Git - nominatim.git/blobdiff - settings/import-extratags.lua
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / settings / import-extratags.lua
index 535af3c8ced1abec65aa3cf1c816e91156f51a10..830345c64e7d0749594a26a3db6fec22697f70de 100644 (file)
@@ -1,17 +1,12 @@
-require('flex-base')
+local flex = require('flex-base')
 
-RELATION_TYPES = {
-    multipolygon = relation_as_multipolygon,
-    boundary = relation_as_multipolygon,
-    waterway = relation_as_multiline
-}
-
-MAIN_KEYS = {
+flex.set_main_tags{
+    building = 'fallback',
     emergency = 'always',
+    healthcare = 'fallback',
     historic = 'always',
     military = 'always',
     natural = 'named',
-    landuse = 'named',
     highway = {'always',
                street_lamp = 'named',
                traffic_signals = 'named',
@@ -31,12 +26,15 @@ MAIN_KEYS = {
     man_made = 'always',
     aerialway = 'always',
     boundary = {'named',
-                postal_code = 'named'},
+                postal_code = 'always'},
     aeroway = 'always',
     amenity = 'always',
     club = 'always',
     craft = 'always',
-    leisure = 'always',
+    junction = 'fallback',
+    landuse = 'fallback',
+    leisure = {'always',
+               nature_reserve = 'fallback'},
     office = 'always',
     mountain_pass = 'always',
     shop = 'always',
@@ -47,55 +45,44 @@ MAIN_KEYS = {
     place = 'always'
 }
 
-MAIN_FALLBACK_KEYS = {
-    building = 'named',
-    landuse = 'named',
-    junction = 'named',
-    healthcare = 'named'
-}
-
-
-PRE_DELETE = tag_match{keys = {'note', 'note:*', 'source', 'source*', 'attribution',
-                               'comment', 'fixme', 'FIXME', 'created_by', 'NHD:*',
-                               'nhd:*', 'gnis:*', 'geobase:*', 'KSJ2:*', 'yh:*',
-                               'osak:*', 'naptan:*', 'CLC:*', 'import', 'it:fvg:*',
-                               'type', 'lacounty:*', 'ref:ruian:*', 'building:ruian:type',
-                               'ref:linz:*', 'is_in:postcode'},
-                       tags = {emergency = {'yes', 'no', 'fire_hydrant'},
-                               historic = {'yes', 'no'},
-                               military = {'yes', 'no'},
-                               natural = {'yes', 'no', 'coastline'},
-                               highway = {'no', 'turning_circle', 'mini_roundabout',
-                                          'noexit', 'crossing', 'give_way', 'stop'},
-                               railway = {'level_crossing', 'no', 'rail'},
-                               man_made = {'survey_point', 'cutline'},
-                               aerialway = {'pylon', 'no'},
-                               aeroway = {'no'},
-                               amenity = {'no'},
-                               club = {'no'},
-                               craft = {'no'},
-                               leisure = {'no'},
-                               office = {'no'},
-                               mountain_pass = {'no'},
-                               shop = {'no'},
-                               tourism = {'yes', 'no'},
-                               bridge = {'no'},
-                               tunnel = {'no'},
-                               waterway = {'riverbank'},
-                               building = {'no'},
-                               boundary = {'place'}}
-                      }
-
-POST_DELETE = tag_match{keys = {'tiger:*'}}
-
-PRE_EXTRAS = tag_match{keys = {'*:prefix', '*:suffix', 'name:prefix:*', 'name:suffix:*',
+flex.set_prefilters{delete_keys = {'note', 'note:*', 'source', '*source', 'attribution',
+                                   'comment', 'fixme', 'FIXME', 'created_by', 'NHD:*',
+                                   'nhd:*', 'gnis:*', 'geobase:*', 'KSJ2:*', 'yh:*',
+                                   'osak:*', 'naptan:*', 'CLC:*', 'import', 'it:fvg:*',
+                                   'type', 'lacounty:*', 'ref:ruian:*', 'building:ruian:type',
+                                   'ref:linz:*', 'is_in:postcode'},
+                    delete_tags = {emergency = {'yes', 'no', 'fire_hydrant'},
+                                   historic = {'yes', 'no'},
+                                   military = {'yes', 'no'},
+                                   natural = {'yes', 'no', 'coastline'},
+                                   highway = {'no', 'turning_circle', 'mini_roundabout',
+                                              'noexit', 'crossing', 'give_way', 'stop'},
+                                   railway = {'level_crossing', 'no', 'rail', 'switch',
+                                              'abandoned', 'signal', 'buffer_stop', 'razed'},
+                                   man_made = {'survey_point', 'cutline'},
+                                   aerialway = {'pylon', 'no'},
+                                   aeroway = {'no'},
+                                   amenity = {'no', 'parking_space', 'parking_entrance'},
+                                   club = {'no'},
+                                   craft = {'no'},
+                                   leisure = {'no'},
+                                   office = {'no'},
+                                   mountain_pass = {'no'},
+                                   shop = {'no'},
+                                   tourism = {'yes', 'no'},
+                                   bridge = {'no'},
+                                   tunnel = {'no'},
+                                   waterway = {'riverbank'},
+                                   building = {'no'},
+                                   boundary = {'place', 'land_area'}},
+                    extra_keys = {'*:prefix', '*:suffix', 'name:prefix:*', 'name:suffix:*',
                                'name:etymology', 'name:signed', 'name:botanical',
                                'wikidata', '*:wikidata',
+                               '*:wikipedia', 'brand:wikipedia:*',
                                'addr:street:name', 'addr:street:type'}
-                      }
+                   }
 
-
-NAMES = tag_match{keys = {'name', 'name:*',
+flex.set_name_tags{main = {'name', 'name:*',
                           'int_name', 'int_name:*',
                           'nat_name', 'nat_name:*',
                           'reg_name', 'reg_name:*',
@@ -104,27 +91,26 @@ NAMES = tag_match{keys = {'name', 'name:*',
                           'alt_name', 'alt_name:*', 'alt_name_*',
                           'official_name', 'official_name:*',
                           'place_name', 'place_name:*',
-                          'short_name', 'short_name:*', 'brand'}}
-
-REFS = tag_match{keys = {'ref', 'int_ref', 'nat_ref', 'reg_ref', 'loc_ref', 'old_ref',
-                         'iata', 'icao', 'pcode', 'pcode:*', 'ISO3166-2'}}
-
-POSTCODES = tag_match{keys = {'postal_code', 'postcode', 'addr:postcode',
-                              'tiger:zip_left', 'tiger:zip_right'}}
-
-COUNTRY_TAGS = tag_match{keys = {'country_code', 'ISO3166-1',
+                          'short_name', 'short_name:*', 'brand'},
+                   extra = {'ref', 'int_ref', 'nat_ref', 'reg_ref',
+                            'loc_ref', 'old_ref',
+                            'iata', 'icao', 'pcode', 'pcode:*', 'ISO3166-2'},
+                   house = {'addr:housename'}
+                  }
+
+flex.set_address_tags{main = {'addr:housenumber',
+                              'addr:conscriptionnumber',
+                              'addr:streetnumber'},
+                      extra = {'addr:*', 'is_in:*', 'tiger:county'},
+                      postcode = {'postal_code', 'postcode', 'addr:postcode',
+                                  'tiger:zip_left', 'tiger:zip_right'},
+                      country = {'country_code', 'ISO3166-1',
                                  'addr:country_code', 'is_in:country_code',
-                                 'addr:country', 'is_in:country'}}
-
-HOUSENAME_TAGS = tag_match{keys = {'addr:housename'}}
-
-HOUSENUMBER_TAGS = tag_match{keys = {'addr:housenumber', 'addr:conscriptionnumber',
-                                     'addr:streetnumber'}}
-
-INTERPOLATION_TAGS = tag_match{keys = {'addr:interpolation'}}
+                                 'addr:country', 'is_in:country'},
+                      interpolation = {'addr:interpolation'}
+                     }
 
-ADDRESS_TAGS = tag_match{keys = {'addr:*', 'is_in:*'}}
-ADD_TIGER_COUNTY = true
 
-SAVE_EXTRA_MAINS = true
+flex.set_unused_handling{delete_keys = {'tiger:*'}}
 
+return flex