]> git.openstreetmap.org Git - nominatim.git/blob - lib-lua/themes/nominatim/presets.lua
d8aa75340251f1c583e3a3906829d4f6976eea41
[nominatim.git] / lib-lua / themes / nominatim / presets.lua
1 -- Defines defaults used in the topic definitions.
2
3 local module = {}
4
5 -- Customized main tag filter functions
6
7 local EXCLUDED_FOOTWAYS = { sidewalk = 1, crossing = 1, link = 1, traffic_aisle }
8
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
13             return place
14         end
15     end
16     return false
17 end
18
19 -- Main tag definition
20
21 module.MAIN_TAGS = {}
22
23 module.MAIN_TAGS.admin = {
24     boundary = {administrative = 'named'},
25     landuse = {residential = 'fallback',
26                farm = 'fallback',
27                farmyard = 'fallback',
28                industrial = 'fallback',
29                commercial = 'fallback',
30                allotments = 'fallback',
31                retail = 'fallback'},
32     place = {county = 'always',
33              district = 'always',
34              municipality = 'always',
35              city = 'always',
36              town = 'always',
37              borough = 'always',
38              village = 'always',
39              suburb = 'always',
40              hamlet = 'always',
41              croft = 'always',
42              subdivision = 'always',
43              allotments = 'always',
44              neighbourhood = 'always',
45              quarter = 'always',
46              isolated_dwelling = 'always',
47              farm = 'always',
48              city_block = 'always',
49              locality = 'always'}
50 }
51
52 module.MAIN_TAGS.all_boundaries = {
53     boundary = {'named',
54                 place = 'delete',
55                 land_area = 'delete',
56                 postal_code = 'always'},
57     landuse = 'fallback',
58     place = 'always'
59 }
60
61 module.MAIN_TAGS.natural = {
62     waterway = {'named',
63                 riverbank = 'delete'},
64     natural = {'named',
65                yes = 'delete',
66                no = 'delete',
67                coastline = 'delete',
68                saddle = 'fallback'},
69     mountain_pass = {'always',
70                      no = 'delete'}
71 }
72
73 module.MAIN_TAGS_POIS = function (group)
74     group = group or 'delete'
75     return {
76     aerialway = {'always',
77                  no = group,
78                  pylon = group},
79     aeroway = {'always',
80                no = group},
81     amenity = {'always',
82                no = group,
83                parking_space = group,
84                parking_entrance = group,
85                waste_disposal = group,
86                hunting_stand = group},
87     building = {'fallback',
88                 no = group},
89     bridge = {'named_with_key',
90               no = group},
91     club = {'always',
92             no = group},
93     craft = {'always',
94              no = group},
95     emergency = {'always',
96                  no = group,
97                  yes = group,
98                  fire_hydrant = group},
99     healthcare = {'fallback',
100                   yes = group,
101                   no = group},
102     highway = {'always',
103                no = group,
104                turning_circle = group,
105                mini_roundabout = group,
106                noexit = group,
107                crossing = group,
108                give_way = group,
109                stop = group,
110                turning_loop = group,
111                passing_place = group,
112                street_lamp = 'named',
113                traffic_signals = 'named'},
114     historic = {'always',
115                 yes = group,
116                 no = group},
117     junction = {'fallback',
118                 no = group},
119     leisure = {'always',
120                nature_reserve = 'fallback',
121                no = group},
122     man_made = {pier = 'always',
123                 tower = 'always',
124                 bridge = 'always',
125                 works = 'named',
126                 water_tower = 'always',
127                 dyke = 'named',
128                 adit = 'named',
129                 lighthouse = 'always',
130                 watermill = 'always',
131                 tunnel = 'always'},
132     military = {'always',
133                 yes = group,
134                 no = group},
135     office = {'always',
136               no = group},
137     railway = {'named',
138                rail = group,
139                no = group,
140                abandoned = group,
141                disused = group,
142                razed = group,
143                level_crossing = group,
144                switch = group,
145                signal = group,
146                buffer_stop = group},
147     shop = {'always',
148             no = group},
149     tourism = {'always',
150                no = group,
151                yes = group},
152     tunnel = {'named_with_key',
153               no = group}
154 } end
155
156 module.MAIN_TAGS_STREETS = {}
157
158 module.MAIN_TAGS_STREETS.default = {
159     place = {square = 'always'},
160     highway = {motorway = 'always',
161                trunk = 'always',
162                primary = 'always',
163                secondary = 'always',
164                tertiary = 'always',
165                unclassified = 'always',
166                residential = 'always',
167                road = 'always',
168                living_street = 'always',
169                pedestrian = 'always',
170                service = 'named',
171                cycleway = 'named',
172                path = 'named',
173                footway = filter_footways,
174                steps = 'named',
175                bridleway = 'named',
176                track = 'named',
177                motorway_link = 'named',
178                trunk_link = 'named',
179                primary_link = 'named',
180                secondary_link = 'named',
181                tertiary_link = 'named'}
182 }
183
184 module.MAIN_TAGS_STREETS.car = {
185     place = {square = 'always'},
186     highway = {motorway = 'always',
187                trunk = 'always',
188                primary = 'always',
189                secondary = 'always',
190                tertiary = 'always',
191                unclassified = 'always',
192                residential = 'always',
193                road = 'always',
194                living_street = 'always',
195                service = 'always',
196                track = 'always',
197                motorway_link = 'always',
198                trunk_link = 'always',
199                primary_link = 'always',
200                secondary_link = 'always',
201                tertiary_link = 'always'}
202 }
203
204 module.MAIN_TAGS_STREETS.all = {
205     place = {square = 'always'},
206     highway = {motorway = 'always',
207                trunk = 'always',
208                primary = 'always',
209                secondary = 'always',
210                tertiary = 'always',
211                unclassified = 'always',
212                residential = 'always',
213                road = 'always',
214                living_street = 'always',
215                pedestrian = 'always',
216                service = 'always',
217                cycleway = 'always',
218                path = 'always',
219                footway = 'always',
220                steps = 'always',
221                bridleway = 'always',
222                track = 'always',
223                motorway_link = 'always',
224                trunk_link = 'always',
225                primary_link = 'always',
226                secondary_link = 'always',
227                tertiary_link = 'always'}
228 }
229
230
231 -- name tags
232
233 module.NAME_TAGS = {}
234
235 module.NAME_TAGS.core = {main = {'name', 'name:*',
236                                  'int_name', 'int_name:*',
237                                  'nat_name', 'nat_name:*',
238                                  'reg_name', 'reg_name:*',
239                                  'loc_name', 'loc_name:*',
240                                  'old_name', 'old_name:*',
241                                  'alt_name', 'alt_name:*', 'alt_name_*',
242                                  'official_name', 'official_name:*',
243                                  'place_name', 'place_name:*',
244                                  'short_name', 'short_name:*'},
245                          extra = {'ref', 'int_ref', 'nat_ref', 'reg_ref',
246                                   'loc_ref', 'old_ref', 'ISO3166-2'}
247                         }
248 module.NAME_TAGS.address = {house = {'addr:housename'}}
249 module.NAME_TAGS.poi = {extra = {'ref', 'int_ref', 'nat_ref', 'reg_ref',
250                                        'loc_ref', 'old_ref',
251                                        'iata', 'icao',
252                                        'ISO3166-2'}}
253
254 -- Address tagging
255
256 module.ADDRESS_TAGS = {}
257
258 module.ADDRESS_TAGS.core = { extra = {'addr:*', 'is_in:*', 'tiger:county'},
259                              postcode = {'postal_code', 'postcode', 'addr:postcode',
260                                          'tiger:zip_left', 'tiger:zip_right'},
261                              country = {'country_code', 'ISO3166-1',
262                                         'addr:country_code', 'is_in:country_code',
263                                         'addr:country', 'is_in:country'}
264                            }
265
266 module.ADDRESS_TAGS.houses = { main = {'addr:housenumber',
267                                        'addr:conscriptionnumber',
268                                        'addr:streetnumber'},
269                                interpolation = {'addr:interpolation'}
270                              }
271
272 -- Ignored tags (prefiltered away)
273
274 module.IGNORE_KEYS = {}
275
276 module.IGNORE_KEYS.metatags = {'note', 'note:*', 'source', 'source:*', '*source',
277                                'attribution', 'comment', 'fixme', 'created_by',
278                                'tiger:cfcc', 'tiger:reviewed', 'nysgissam:*',
279                                'NHD:*', 'nhd:*', 'gnis:*', 'geobase:*', 'yh:*',
280                                'osak:*', 'naptan:*', 'CLC:*', 'import', 'it:fvg:*',
281                                'lacounty:*', 'ref:linz:*',
282                                'ref:bygningsnr', 'ref:ruian:*', 'building:ruian:type',
283                                'type',
284                                'is_in:postcode'}
285 module.IGNORE_KEYS.name = {'*:prefix', '*:suffix', 'name:prefix:*', 'name:suffix:*',
286                            'name:etymology', 'name:signed', 'name:botanical'}
287 module.IGNORE_KEYS.address = {'addr:street:*', 'addr:city:*', 'addr:district:*',
288                               'addr:province:*', 'addr:subdistrict:*', 'addr:place:*',
289                               'addr:TW:dataset'}
290
291 -- Extra tags (prefiltered away)
292
293 module.EXTRATAGS = {}
294
295 module.EXTRATAGS.required = {'wikipedia', 'wikipedia:*', 'wikidata', 'capital'}
296
297 return module