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 local function lock_transform(place)
57 if place.object.tags.waterway ~= nil then
58 local name = place.object.tags.lock_name
60 return place:clone{names={name=name, ref=place.object.tags.lock_ref}}
67 -- Main tag definition
71 module.MAIN_TAGS.admin = {
72 boundary = {administrative = 'named'},
73 landuse = {residential = 'fallback',
75 farmyard = 'fallback',
76 industrial = 'fallback',
77 commercial = 'fallback',
78 allotments = 'fallback',
80 place = {county = 'always',
82 municipality = 'always',
90 subdivision = 'always',
91 allotments = 'always',
92 neighbourhood = 'always',
94 isolated_dwelling = 'always',
96 city_block = 'always',
100 module.MAIN_TAGS.all_boundaries = {
103 land_area = 'delete',
104 postal_code = 'always'},
105 landuse = 'fallback',
109 module.MAIN_TAGS.natural = {
111 riverbank = 'delete'},
115 coastline = 'delete',
117 water = exclude_when_key_present('water', true)},
118 mountain_pass = {'always',
120 water = {include_when_tag_present('natural', 'water', true),
128 intermittent = 'delete',
133 module.MAIN_TAGS_POIS = function (group)
134 group = group or 'delete'
136 aerialway = {'always',
143 parking_space = group,
144 parking_entrance = group,
145 waste_disposal = group,
146 hunting_stand = group},
147 building = {'fallback',
149 bridge = {'named_with_key',
155 emergency = {'always',
158 fire_hydrant = group},
159 healthcare = {'fallback',
164 turning_circle = group,
165 mini_roundabout = group,
170 turning_loop = group,
171 passing_place = group,
172 street_lamp = 'named',
173 traffic_signals = 'named'},
174 historic = {'always',
177 information = {include_when_tag_present('tourism', 'information')},
178 junction = {'fallback',
181 nature_reserve = 'fallback',
182 swimming_pool = 'named',
184 lock = {yes = lock_transform},
185 man_made = {pier = 'always',
189 water_tower = 'always',
192 lighthouse = 'always',
193 watermill = 'always',
195 military = {'always',
206 level_crossing = group,
209 buffer_stop = group},
215 information = 'fallback'},
216 tunnel = {'named_with_key',
220 module.MAIN_TAGS_STREETS = {}
222 module.MAIN_TAGS_STREETS.default = {
223 place = {square = 'always'},
224 highway = {motorway = 'always',
227 secondary = 'always',
229 unclassified = 'always',
230 residential = 'always',
232 living_street = 'always',
233 pedestrian = 'always',
237 footway = filter_footways,
241 motorway_link = 'named',
242 trunk_link = 'named',
243 primary_link = 'named',
244 secondary_link = 'named',
245 tertiary_link = 'named'}
248 module.MAIN_TAGS_STREETS.car = {
249 place = {square = 'always'},
250 highway = {motorway = 'always',
253 secondary = 'always',
255 unclassified = 'always',
256 residential = 'always',
258 living_street = 'always',
261 motorway_link = 'always',
262 trunk_link = 'always',
263 primary_link = 'always',
264 secondary_link = 'always',
265 tertiary_link = 'always'}
268 module.MAIN_TAGS_STREETS.all = {
269 place = {square = 'always'},
270 highway = {motorway = 'always',
273 secondary = 'always',
275 unclassified = 'always',
276 residential = 'always',
278 living_street = 'always',
279 pedestrian = 'always',
285 bridleway = 'always',
287 motorway_link = 'always',
288 trunk_link = 'always',
289 primary_link = 'always',
290 secondary_link = 'always',
291 tertiary_link = 'always'}
297 module.NAME_TAGS = {}
299 module.NAME_TAGS.core = {main = {'name', 'name:*',
300 'int_name', 'int_name:*',
301 'nat_name', 'nat_name:*',
302 'reg_name', 'reg_name:*',
303 'loc_name', 'loc_name:*',
304 'old_name', 'old_name:*',
305 'alt_name', 'alt_name:*', 'alt_name_*',
306 'official_name', 'official_name:*',
307 'place_name', 'place_name:*',
308 'short_name', 'short_name:*'},
309 extra = {'ref', 'int_ref', 'nat_ref', 'reg_ref',
310 'loc_ref', 'old_ref', 'ISO3166-2'}
312 module.NAME_TAGS.address = {house = {'addr:housename'}}
313 module.NAME_TAGS.poi = {extra = {'ref', 'int_ref', 'nat_ref', 'reg_ref',
314 'loc_ref', 'old_ref',
320 module.ADDRESS_TAGS = {}
322 module.ADDRESS_TAGS.core = { extra = {'addr:*', 'is_in:*', 'tiger:county'},
323 postcode = {'postal_code', 'postcode', 'addr:postcode',
324 'tiger:zip_left', 'tiger:zip_right'},
325 country = {'country_code', 'ISO3166-1',
326 'addr:country_code', 'is_in:country_code',
327 'addr:country', 'is_in:country'}
330 module.ADDRESS_TAGS.houses = { main = {'addr:housenumber',
331 'addr:conscriptionnumber',
332 'addr:streetnumber'},
333 interpolation = {'addr:interpolation'}
336 -- Ignored tags (prefiltered away)
338 module.IGNORE_KEYS = {}
340 module.IGNORE_KEYS.metatags = {'note', 'note:*', 'source', 'source:*', '*source',
341 'attribution', 'comment', 'fixme', 'created_by',
342 'tiger:cfcc', 'tiger:reviewed', 'nysgissam:*',
343 'NHD:*', 'nhd:*', 'gnis:*', 'geobase:*', 'yh:*',
344 'osak:*', 'naptan:*', 'CLC:*', 'import', 'it:fvg:*',
345 'lacounty:*', 'ref:linz:*',
346 'ref:bygningsnr', 'ref:ruian:*', 'building:ruian:type',
349 module.IGNORE_KEYS.name = {'*:prefix', '*:suffix', 'name:prefix:*', 'name:suffix:*',
350 'name:etymology', 'name:signed', 'name:botanical'}
351 module.IGNORE_KEYS.address = {'addr:street:*', 'addr:city:*', 'addr:district:*',
352 'addr:province:*', 'addr:subdistrict:*', 'addr:place:*',
355 -- Extra tags (prefiltered away)
357 module.EXTRATAGS = {}
359 module.EXTRATAGS.required = {'wikipedia', 'wikipedia:*', 'wikidata', 'capital'}