1 -- Defines defaults used in the topic definitions.
5 -- Customized main tag filter functions
7 local EXCLUDED_FOOTWAYS = { sidewalk = 1, crossing = 1, link = 1, traffic_aisle }
9 local function filter_footways(place)
10 if place.has_name then
11 local footway = place.object.tags.footway
12 if footway == nil or EXCLUDED_FOOTWAYS[footway] ~= 1 then
19 local function include_when_tag_present(key, value, named)
21 return function(place)
22 if place.has_name and place.intags[key] == value then
28 return function(place)
29 if place.intags[key] == value then
37 local function exclude_when_key_present(key, named)
39 return function(place)
40 if place.has_name and place.intags[key] == nil then
46 return function(place)
47 if place.intags[key] == nil then
56 -- Main tag definition
60 module.MAIN_TAGS.admin = {
61 boundary = {administrative = 'named'},
62 landuse = {residential = 'fallback',
64 farmyard = 'fallback',
65 industrial = 'fallback',
66 commercial = 'fallback',
67 allotments = 'fallback',
69 place = {county = 'always',
71 municipality = 'always',
79 subdivision = 'always',
80 allotments = 'always',
81 neighbourhood = 'always',
83 isolated_dwelling = 'always',
85 city_block = 'always',
89 module.MAIN_TAGS.all_boundaries = {
93 postal_code = 'always'},
98 module.MAIN_TAGS.natural = {
100 riverbank = 'delete'},
104 coastline = 'delete',
106 water = exclude_when_key_present('water', true)},
107 mountain_pass = {'always',
109 water = {include_when_tag_present('natural', 'water', true),
117 intermittent = 'delete',
122 module.MAIN_TAGS_POIS = function (group)
123 group = group or 'delete'
125 aerialway = {'always',
132 parking_space = group,
133 parking_entrance = group,
134 waste_disposal = group,
135 hunting_stand = group},
136 building = {'fallback',
138 bridge = {'named_with_key',
144 emergency = {'always',
147 fire_hydrant = group},
148 healthcare = {'fallback',
153 turning_circle = group,
154 mini_roundabout = group,
159 turning_loop = group,
160 passing_place = group,
161 street_lamp = 'named',
162 traffic_signals = 'named'},
163 historic = {'always',
166 information = {include_when_tag_present('tourism', 'information')},
167 junction = {'fallback',
170 nature_reserve = 'fallback',
172 man_made = {pier = 'always',
176 water_tower = 'always',
179 lighthouse = 'always',
180 watermill = 'always',
182 military = {'always',
193 level_crossing = group,
196 buffer_stop = group},
202 information = 'fallback'},
203 tunnel = {'named_with_key',
207 module.MAIN_TAGS_STREETS = {}
209 module.MAIN_TAGS_STREETS.default = {
210 place = {square = 'always'},
211 highway = {motorway = 'always',
214 secondary = 'always',
216 unclassified = 'always',
217 residential = 'always',
219 living_street = 'always',
220 pedestrian = 'always',
224 footway = filter_footways,
228 motorway_link = 'named',
229 trunk_link = 'named',
230 primary_link = 'named',
231 secondary_link = 'named',
232 tertiary_link = 'named'}
235 module.MAIN_TAGS_STREETS.car = {
236 place = {square = 'always'},
237 highway = {motorway = 'always',
240 secondary = 'always',
242 unclassified = 'always',
243 residential = 'always',
245 living_street = 'always',
248 motorway_link = 'always',
249 trunk_link = 'always',
250 primary_link = 'always',
251 secondary_link = 'always',
252 tertiary_link = 'always'}
255 module.MAIN_TAGS_STREETS.all = {
256 place = {square = 'always'},
257 highway = {motorway = 'always',
260 secondary = 'always',
262 unclassified = 'always',
263 residential = 'always',
265 living_street = 'always',
266 pedestrian = 'always',
272 bridleway = 'always',
274 motorway_link = 'always',
275 trunk_link = 'always',
276 primary_link = 'always',
277 secondary_link = 'always',
278 tertiary_link = 'always'}
284 module.NAME_TAGS = {}
286 module.NAME_TAGS.core = {main = {'name', 'name:*',
287 'int_name', 'int_name:*',
288 'nat_name', 'nat_name:*',
289 'reg_name', 'reg_name:*',
290 'loc_name', 'loc_name:*',
291 'old_name', 'old_name:*',
292 'alt_name', 'alt_name:*', 'alt_name_*',
293 'official_name', 'official_name:*',
294 'place_name', 'place_name:*',
295 'short_name', 'short_name:*'},
296 extra = {'ref', 'int_ref', 'nat_ref', 'reg_ref',
297 'loc_ref', 'old_ref', 'ISO3166-2'}
299 module.NAME_TAGS.address = {house = {'addr:housename'}}
300 module.NAME_TAGS.poi = {extra = {'ref', 'int_ref', 'nat_ref', 'reg_ref',
301 'loc_ref', 'old_ref',
307 module.ADDRESS_TAGS = {}
309 module.ADDRESS_TAGS.core = { extra = {'addr:*', 'is_in:*', 'tiger:county'},
310 postcode = {'postal_code', 'postcode', 'addr:postcode',
311 'tiger:zip_left', 'tiger:zip_right'},
312 country = {'country_code', 'ISO3166-1',
313 'addr:country_code', 'is_in:country_code',
314 'addr:country', 'is_in:country'}
317 module.ADDRESS_TAGS.houses = { main = {'addr:housenumber',
318 'addr:conscriptionnumber',
319 'addr:streetnumber'},
320 interpolation = {'addr:interpolation'}
323 -- Ignored tags (prefiltered away)
325 module.IGNORE_KEYS = {}
327 module.IGNORE_KEYS.metatags = {'note', 'note:*', 'source', 'source:*', '*source',
328 'attribution', 'comment', 'fixme', 'created_by',
329 'tiger:cfcc', 'tiger:reviewed', 'nysgissam:*',
330 'NHD:*', 'nhd:*', 'gnis:*', 'geobase:*', 'yh:*',
331 'osak:*', 'naptan:*', 'CLC:*', 'import', 'it:fvg:*',
332 'lacounty:*', 'ref:linz:*',
333 'ref:bygningsnr', 'ref:ruian:*', 'building:ruian:type',
336 module.IGNORE_KEYS.name = {'*:prefix', '*:suffix', 'name:prefix:*', 'name:suffix:*',
337 'name:etymology', 'name:signed', 'name:botanical'}
338 module.IGNORE_KEYS.address = {'addr:street:*', 'addr:city:*', 'addr:district:*',
339 'addr:province:*', 'addr:subdistrict:*', 'addr:place:*',
342 -- Extra tags (prefiltered away)
344 module.EXTRATAGS = {}
346 module.EXTRATAGS.required = {'wikipedia', 'wikipedia:*', 'wikidata', 'capital'}