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',
183 lock = {yes = lock_transform},
184 man_made = {pier = 'always',
188 water_tower = 'always',
191 lighthouse = 'always',
192 watermill = 'always',
194 military = {'always',
205 level_crossing = group,
208 buffer_stop = group},
214 information = 'fallback'},
215 tunnel = {'named_with_key',
219 module.MAIN_TAGS_STREETS = {}
221 module.MAIN_TAGS_STREETS.default = {
222 place = {square = 'always'},
223 highway = {motorway = 'always',
226 secondary = 'always',
228 unclassified = 'always',
229 residential = 'always',
231 living_street = 'always',
232 pedestrian = 'always',
236 footway = filter_footways,
240 motorway_link = 'named',
241 trunk_link = 'named',
242 primary_link = 'named',
243 secondary_link = 'named',
244 tertiary_link = 'named'}
247 module.MAIN_TAGS_STREETS.car = {
248 place = {square = 'always'},
249 highway = {motorway = 'always',
252 secondary = 'always',
254 unclassified = 'always',
255 residential = 'always',
257 living_street = 'always',
260 motorway_link = 'always',
261 trunk_link = 'always',
262 primary_link = 'always',
263 secondary_link = 'always',
264 tertiary_link = 'always'}
267 module.MAIN_TAGS_STREETS.all = {
268 place = {square = 'always'},
269 highway = {motorway = 'always',
272 secondary = 'always',
274 unclassified = 'always',
275 residential = 'always',
277 living_street = 'always',
278 pedestrian = 'always',
284 bridleway = 'always',
286 motorway_link = 'always',
287 trunk_link = 'always',
288 primary_link = 'always',
289 secondary_link = 'always',
290 tertiary_link = 'always'}
296 module.NAME_TAGS = {}
298 module.NAME_TAGS.core = {main = {'name', 'name:*',
299 'int_name', 'int_name:*',
300 'nat_name', 'nat_name:*',
301 'reg_name', 'reg_name:*',
302 'loc_name', 'loc_name:*',
303 'old_name', 'old_name:*',
304 'alt_name', 'alt_name:*', 'alt_name_*',
305 'official_name', 'official_name:*',
306 'place_name', 'place_name:*',
307 'short_name', 'short_name:*'},
308 extra = {'ref', 'int_ref', 'nat_ref', 'reg_ref',
309 'loc_ref', 'old_ref', 'ISO3166-2'}
311 module.NAME_TAGS.address = {house = {'addr:housename'}}
312 module.NAME_TAGS.poi = {extra = {'ref', 'int_ref', 'nat_ref', 'reg_ref',
313 'loc_ref', 'old_ref',
319 module.ADDRESS_TAGS = {}
321 module.ADDRESS_TAGS.core = { extra = {'addr:*', 'is_in:*', 'tiger:county'},
322 postcode = {'postal_code', 'postcode', 'addr:postcode',
323 'tiger:zip_left', 'tiger:zip_right'},
324 country = {'country_code', 'ISO3166-1',
325 'addr:country_code', 'is_in:country_code',
326 'addr:country', 'is_in:country'}
329 module.ADDRESS_TAGS.houses = { main = {'addr:housenumber',
330 'addr:conscriptionnumber',
331 'addr:streetnumber'},
332 interpolation = {'addr:interpolation'}
335 -- Ignored tags (prefiltered away)
337 module.IGNORE_KEYS = {}
339 module.IGNORE_KEYS.metatags = {'note', 'note:*', 'source', 'source:*', '*source',
340 'attribution', 'comment', 'fixme', 'created_by',
341 'tiger:cfcc', 'tiger:reviewed', 'nysgissam:*',
342 'NHD:*', 'nhd:*', 'gnis:*', 'geobase:*', 'yh:*',
343 'osak:*', 'naptan:*', 'CLC:*', 'import', 'it:fvg:*',
344 'lacounty:*', 'ref:linz:*',
345 'ref:bygningsnr', 'ref:ruian:*', 'building:ruian:type',
348 module.IGNORE_KEYS.name = {'*:prefix', '*:suffix', 'name:prefix:*', 'name:suffix:*',
349 'name:etymology', 'name:signed', 'name:botanical'}
350 module.IGNORE_KEYS.address = {'addr:street:*', 'addr:city:*', 'addr:district:*',
351 'addr:province:*', 'addr:subdistrict:*', 'addr:place:*',
354 -- Extra tags (prefiltered away)
356 module.EXTRATAGS = {}
358 module.EXTRATAGS.required = {'wikipedia', 'wikipedia:*', 'wikidata', 'capital'}