mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
switch to subtags for tourism=information and natural=water
This commit is contained in:
@@ -16,6 +16,43 @@ local function filter_footways(place)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function include_when_tag_present(key, value, named)
|
||||||
|
if named then
|
||||||
|
return function(place)
|
||||||
|
if place.has_name and place.intags[key] == value then
|
||||||
|
return place
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return function(place)
|
||||||
|
if place.intags[key] == value then
|
||||||
|
return place
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function exclude_when_key_present(key, named)
|
||||||
|
if named then
|
||||||
|
return function(place)
|
||||||
|
if place.has_name and place.intags[key] == nil then
|
||||||
|
return place
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return function(place)
|
||||||
|
if place.intags[key] == nil then
|
||||||
|
return place
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Main tag definition
|
-- Main tag definition
|
||||||
|
|
||||||
module.MAIN_TAGS = {}
|
module.MAIN_TAGS = {}
|
||||||
@@ -65,9 +102,21 @@ module.MAIN_TAGS.natural = {
|
|||||||
yes = 'delete',
|
yes = 'delete',
|
||||||
no = 'delete',
|
no = 'delete',
|
||||||
coastline = 'delete',
|
coastline = 'delete',
|
||||||
saddle = 'fallback'},
|
saddle = 'fallback',
|
||||||
|
water = exclude_when_key_present('water', true)},
|
||||||
mountain_pass = {'always',
|
mountain_pass = {'always',
|
||||||
no = 'delete'}
|
no = 'delete'},
|
||||||
|
water = {include_when_tag_present('natural', 'water', true),
|
||||||
|
river = 'never',
|
||||||
|
stream = 'never',
|
||||||
|
canal = 'never',
|
||||||
|
ditch = 'never',
|
||||||
|
drain = 'never',
|
||||||
|
fish_pass = 'never',
|
||||||
|
yes = 'delete',
|
||||||
|
intermittent = 'delete',
|
||||||
|
tidal = 'delete'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.MAIN_TAGS_POIS = function (group)
|
module.MAIN_TAGS_POIS = function (group)
|
||||||
@@ -114,6 +163,7 @@ module.MAIN_TAGS_POIS = function (group)
|
|||||||
historic = {'always',
|
historic = {'always',
|
||||||
yes = group,
|
yes = group,
|
||||||
no = group},
|
no = group},
|
||||||
|
information = {include_when_tag_present('tourism', 'information')},
|
||||||
junction = {'fallback',
|
junction = {'fallback',
|
||||||
no = group},
|
no = group},
|
||||||
leisure = {'always',
|
leisure = {'always',
|
||||||
@@ -148,7 +198,8 @@ module.MAIN_TAGS_POIS = function (group)
|
|||||||
no = group},
|
no = group},
|
||||||
tourism = {'always',
|
tourism = {'always',
|
||||||
no = group,
|
no = group,
|
||||||
yes = group},
|
yes = group,
|
||||||
|
information = 'fallback'},
|
||||||
tunnel = {'named_with_key',
|
tunnel = {'named_with_key',
|
||||||
no = group}
|
no = group}
|
||||||
} end
|
} end
|
||||||
|
|||||||
@@ -223,3 +223,36 @@ Feature: Tag evaluation
|
|||||||
| object | name+name |
|
| object | name+name |
|
||||||
| W2 | Road |
|
| W2 | Road |
|
||||||
| W5 | Road |
|
| W5 | Road |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Tourism information
|
||||||
|
When loading osm data
|
||||||
|
"""
|
||||||
|
n100 Ttourism=information
|
||||||
|
n101 Ttourism=information,name=Generic
|
||||||
|
n102 Ttourism=information,information=guidepost
|
||||||
|
n103 Thighway=information,information=house
|
||||||
|
"""
|
||||||
|
Then place contains exactly
|
||||||
|
| object | type |
|
||||||
|
| N101:tourism | information |
|
||||||
|
| N102:information | guidepost |
|
||||||
|
| N103:highway | information |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: Water feautures
|
||||||
|
When loading osm data
|
||||||
|
"""
|
||||||
|
n20 Tnatural=water
|
||||||
|
n21 Tnatural=water,name=SomePond
|
||||||
|
n22 Tnatural=water,water=pond
|
||||||
|
n23 Tnatural=water,water=pond,name=Pond
|
||||||
|
n24 Tnatural=water,water=river,name=BigRiver
|
||||||
|
n25 Tnatural=water,water=yes
|
||||||
|
n26 Tnatural=water,water=yes,name=Random
|
||||||
|
"""
|
||||||
|
Then place contains exactly
|
||||||
|
| object | type |
|
||||||
|
| N21:natural | water |
|
||||||
|
| N23:water | pond |
|
||||||
|
| N26:natural | water |
|
||||||
|
|||||||
Reference in New Issue
Block a user