]> git.openstreetmap.org Git - nominatim.git/commitdiff
flez: add other default styles
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 16 Dec 2022 10:19:37 +0000 (11:19 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 18 Dec 2022 09:10:58 +0000 (10:10 +0100)
settings/flex-base.lua
settings/import-address.lua [new file with mode: 0644]
settings/import-admin.lua [new file with mode: 0644]
settings/import-full.lua [new file with mode: 0644]
settings/import-street.lua [new file with mode: 0644]

index fb39a32ddbaf71fa43d25858a151c8e1caa4a2b4..f3d977a3b630d80d0e58be500da3a412bdcf5d26 100644 (file)
@@ -8,6 +8,8 @@ local PRE_EXTRAS = nil
 local MAIN_KEYS = nil
 local NAMES = nil
 local ADDRESS_TAGS = nil
+local SAVE_EXTRA_MAINS = false
+local POSTCODE_FALLBACK = true
 
 
 -- The single place table.
@@ -474,7 +476,7 @@ function module.process_tags(o)
     if o.address.country ~= nil and #o.address.country ~= 2 then
         o.address['country'] = nil
     end
-    if fallback == nil and o.address.postcode ~= nil then
+    if POSTCODE_FALLBACK and fallback == nil and o.address.postcode ~= nil then
         fallback = {'place', 'postcode', 'always'}
     end
 
@@ -520,6 +522,11 @@ function module.set_name_tags(data)
 end
 
 function module.set_address_tags(data)
+    if data.postcode_fallback ~= nil then
+        POSTCODE_FALLBACK = data.postcode_fallback
+        data.postcode_fallback = nil
+    end
+
     ADDRESS_TAGS = module.tag_group(data)
 end
 
diff --git a/settings/import-address.lua b/settings/import-address.lua
new file mode 100644 (file)
index 0000000..2bd9253
--- /dev/null
@@ -0,0 +1,67 @@
+flex = require('flex-base')
+
+flex.set_main_tags{
+    highway = {'always',
+               street_lamp = 'named',
+               traffic_signals = 'named',
+               service = 'named',
+               cycleway = 'named',
+               path = 'named',
+               footway = 'named',
+               steps = 'named',
+               bridleway = 'named',
+               track = 'named',
+               motorway_link = 'named',
+               trunk_link = 'named',
+               primary_link = 'named',
+               secondary_link = 'named',
+               tertiary_link = 'named'},
+    boundary = {administrative = 'named',
+                postal_code = 'named'},
+    landuse = 'fallback',
+    place = 'always'
+}
+
+flex.set_prefilters{delete_keys = {'building', 'source',
+                                   'source', '*source', 'type',
+                                   'is_in:postcode', '*:wikidata',
+                                   '*:prefix', '*:suffix', 'name:prefix:*', 'name:suffix:*',
+                                   'name:etymology', 'name:signed', 'name:botanical',
+                                   'addr:street:name', 'addr:street:type'},
+                    delete_tags = {highway = {'no', 'turning_circle', 'mini_roundabout',
+                                              'noexit', 'crossing', 'give_way', 'stop'},
+                                   landuse = {'cemetry', 'no'},
+                                   boundary = {'place'}},
+                    extratag_keys = {'wikipedia', 'wikipedia:*', 'wikidata', 'capital', 'area'}
+                   }
+
+flex.set_name_tags{main = {'name', 'name:*',
+                          'int_name', 'int_name:*',
+                          'nat_name', 'nat_name:*',
+                          'reg_name', 'reg_name:*',
+                          'loc_name', 'loc_name:*',
+                          'old_name', 'old_name:*',
+                          'alt_name', 'alt_name:*', 'alt_name_*',
+                          'official_name', 'official_name:*',
+                          'place_name', 'place_name:*',
+                          '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'},
+                      interpolation = {'addr:interpolation'}
+                     }
+
+
+flex.set_unused_handling{extra_keys = {'place'}}
diff --git a/settings/import-admin.lua b/settings/import-admin.lua
new file mode 100644 (file)
index 0000000..d45fa8f
--- /dev/null
@@ -0,0 +1,44 @@
+flex = require('flex-base')
+
+flex.set_main_tags{
+    boundary = {administrative = 'named'},
+    landuse = 'fallback',
+    place = 'always'
+}
+
+flex.set_prefilters{delete_keys = {'building', 'source', 'highway',
+                                   'addr:housenumber', 'addr:street', 'addr:city',
+                                   'source', '*source', 'type',
+                                   'is_in:postcode', '*:wikidata',
+                                   '*:prefix', '*:suffix', 'name:prefix:*', 'name:suffix:*',
+                                   'name:etymology', 'name:signed', 'name:botanical',
+                                   'addr:street:name', 'addr:street:type'},
+                    delete_tags = {landuse = {'cemetry', 'no'},
+                                   boundary = {'place'}},
+                    extratag_keys = {'wikipedia', 'wikipedia:*', 'wikidata', 'capital'}
+                   }
+
+flex.set_name_tags{main = {'name', 'name:*',
+                          'int_name', 'int_name:*',
+                          'nat_name', 'nat_name:*',
+                          'reg_name', 'reg_name:*',
+                          'loc_name', 'loc_name:*',
+                          'old_name', 'old_name:*',
+                          'alt_name', 'alt_name:*', 'alt_name_*',
+                          'official_name', 'official_name:*',
+                          'place_name', 'place_name:*',
+                          'short_name', 'short_name:*', 'brand'},
+                   extra = {'ref', 'int_ref', 'nat_ref', 'reg_ref',
+                            'loc_ref', 'old_ref',
+                            'iata', 'icao', 'pcode', 'pcode:*', 'ISO3166-2'}
+                  }
+
+flex.set_address_tags{extra = {'addr:*', 'is_in:*'},
+                      postcode = {'postal_code', 'postcode', 'addr:postcode'},
+                      country = {'country_code', 'ISO3166-1',
+                                 'addr:country_code', 'is_in:country_code',
+                                 'addr:country', 'is_in:country'},
+                      postcode_fallback = false
+                     }
+
+flex.set_unused_handling{extra_keys = {'place'}}
diff --git a/settings/import-full.lua b/settings/import-full.lua
new file mode 100644 (file)
index 0000000..e00313c
--- /dev/null
@@ -0,0 +1,112 @@
+flex = require('flex-base')
+
+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',
+               service = 'named',
+               cycleway = 'named',
+               path = 'named',
+               footway = 'named',
+               steps = 'named',
+               bridleway = 'named',
+               track = 'named',
+               motorway_link = 'named',
+               trunk_link = 'named',
+               primary_link = 'named',
+               secondary_link = 'named',
+               tertiary_link = 'named'},
+    railway = 'named',
+    man_made = 'always',
+    aerialway = 'always',
+    boundary = {'named',
+                postal_code = 'named'},
+    aeroway = 'always',
+    amenity = 'always',
+    club = 'always',
+    craft = 'always',
+    junction = 'fallback',
+    landuse = 'fallback',
+    leisure = 'always',
+    office = 'always',
+    mountain_pass = 'always',
+    shop = 'always',
+    tourism = 'always',
+    bridge = 'named_with_key',
+    tunnel = 'named_with_key',
+    waterway = 'named',
+    place = 'always'
+}
+
+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'},
+                                   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'}},
+                    extratag_keys = {'*:prefix', '*:suffix', 'name:prefix:*', 'name:suffix:*',
+                               'name:etymology', 'name:signed', 'name:botanical',
+                               'wikidata', '*:wikidata',
+                               'addr:street:name', 'addr:street:type'}
+                   }
+
+flex.set_name_tags{main = {'name', 'name:*',
+                          'int_name', 'int_name:*',
+                          'nat_name', 'nat_name:*',
+                          'reg_name', 'reg_name:*',
+                          'loc_name', 'loc_name:*',
+                          'old_name', 'old_name:*',
+                          'alt_name', 'alt_name:*', 'alt_name_*',
+                          'official_name', 'official_name:*',
+                          'place_name', 'place_name:*',
+                          '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'},
+                      interpolation = {'addr:interpolation'}
+                     }
+
+
+flex.set_unused_handling{extra_keys = {'place'}}
diff --git a/settings/import-street.lua b/settings/import-street.lua
new file mode 100644 (file)
index 0000000..34bff57
--- /dev/null
@@ -0,0 +1,66 @@
+flex = require('flex-base')
+
+flex.set_main_tags{
+    highway = {'always',
+               street_lamp = 'named',
+               traffic_signals = 'named',
+               service = 'named',
+               cycleway = 'named',
+               path = 'named',
+               footway = 'named',
+               steps = 'named',
+               bridleway = 'named',
+               track = 'named',
+               motorway_link = 'named',
+               trunk_link = 'named',
+               primary_link = 'named',
+               secondary_link = 'named',
+               tertiary_link = 'named'},
+    boundary = {administrative = 'named'},
+    landuse = 'fallback',
+    place = 'always'
+}
+
+flex.set_prefilters{delete_keys = {'building', 'source',
+                                   'addr:housenumber', 'addr:street',
+                                   'source', '*source', 'type',
+                                   'is_in:postcode', '*:wikidata',
+                                   '*:prefix', '*:suffix', 'name:prefix:*', 'name:suffix:*',
+                                   'name:etymology', 'name:signed', 'name:botanical',
+                                   'addr:street:name', 'addr:street:type'},
+                    delete_tags = {highway = {'no', 'turning_circle', 'mini_roundabout',
+                                              'noexit', 'crossing', 'give_way', 'stop'},
+                                   landuse = {'cemetry', 'no'},
+                                   boundary = {'place'}},
+                    extratag_keys = {'wikipedia', 'wikipedia:*', 'wikidata', 'capital', 'area'}
+                   }
+
+flex.set_name_tags{main = {'name', 'name:*',
+                          'int_name', 'int_name:*',
+                          'nat_name', 'nat_name:*',
+                          'reg_name', 'reg_name:*',
+                          'loc_name', 'loc_name:*',
+                          'old_name', 'old_name:*',
+                          'alt_name', 'alt_name:*', 'alt_name_*',
+                          'official_name', 'official_name:*',
+                          'place_name', 'place_name:*',
+                          'short_name', 'short_name:*', 'brand'},
+                   extra = {'ref', 'int_ref', 'nat_ref', 'reg_ref',
+                            'loc_ref', 'old_ref',
+                            'iata', 'icao', 'pcode', 'pcode:*', 'ISO3166-2'}
+                  }
+
+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'},
+                      interpolation = {'addr:interpolation'},
+                      postcode_fallback = false
+                     }
+
+flex.set_unused_handling{extra_keys = {'place'}}