Skip to content

Commit fa52baf

Browse files
authored
Merge pull request #13 from pnorman/pois
Make shortbread POI layers follow spec
2 parents f404aad + 9ebb7cd commit fa52baf

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

themes/shortbread_v1/topics/addresses.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ end
4141

4242
themepark:add_proc('node', function(object, data)
4343
-- Shortbread spec: Ignore addresses that are already in "pois" layer.
44-
if data.in_pois then
44+
if data.shortbread_in_pois then
4545
return
4646
end
4747

@@ -54,7 +54,7 @@ end)
5454

5555
themepark:add_proc('way', function(object, data)
5656
-- Shortbread spec: Ignore addresses that are already in "pois" layer.
57-
if data.in_pois or not object.is_closed then
57+
if data.shortbread_in_pois or not object.is_closed then
5858
return
5959
end
6060

@@ -67,7 +67,7 @@ end)
6767

6868
themepark:add_proc('relation', function(object, data)
6969
-- Shortbread spec: Ignore addresses that are already in "pois" layer.
70-
if data.in_pois then
70+
if data.shortbread_in_pois then
7171
return
7272
end
7373

themes/shortbread_v1/topics/pois.lua

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ themepark:add_table{
2727
{ column = 'sport', type = 'text' },
2828
{ column = 'vending', type = 'text' },
2929
{ column = 'information', type = 'text' },
30-
{ column = 'tower_type', type = 'text' },
30+
{ column = 'tower:type', type = 'text' },
3131
{ column = 'religion', type = 'text' },
3232
{ column = 'denomination', type = 'text' },
33-
{ column = 'recycling_glass_bottles', type = 'bool' },
34-
{ column = 'recycling_paper', type = 'bool' },
35-
{ column = 'recycling_clothes', type = 'bool' },
36-
{ column = 'recycling_scrap_metal', type = 'bool' },
33+
{ column = 'recycling:glass_bottles', type = 'bool' },
34+
{ column = 'recycling:paper', type = 'bool' },
35+
{ column = 'recycling:clothes', type = 'bool' },
36+
{ column = 'recycling:scrap_metal', type = 'bool' },
3737
{ column = 'atm', type = 'bool' },
3838
}),
3939
tags = {
@@ -117,10 +117,10 @@ add_extra_attributes.amenity = function(a, t)
117117
t.amenity == 'pub' or t.amenity == 'bar' or t.amenity == 'cafe' then
118118
a.cuisine = t.cuisine
119119
elseif t.amenity == 'recycling' then
120-
a.recycling_glass_bottles = t['recycling:glass_bottles'] == 'yes'
121-
a.recycling_paper = t['recycling:paper'] == 'yes'
122-
a.recycling_clothes = t['recycling:clothes'] == 'yes'
123-
a.recycling_scrap_metal = t['recycling:scrap_metal'] == 'yes'
120+
a['recycling:glass_bottles'] = t['recycling:glass_bottles'] == 'yes'
121+
a['recycling:paper'] = t['recycling:paper'] == 'yes'
122+
a['recycling:clothes'] = t['recycling:clothes'] == 'yes'
123+
a['recycling:scrap_metal'] = t['recycling:scrap_metal'] == 'yes'
124124
elseif t.amenity == 'bank' then
125125
a.atm = t.atm == 'yes'
126126
end
@@ -134,7 +134,7 @@ end
134134

135135
add_extra_attributes.man_made = function(a, t)
136136
if t.man_made == 'tower' then
137-
a.tower_type = t['tower:type']
137+
a['tower:type'] = t['tower:type']
138138
end
139139
end
140140

@@ -154,7 +154,6 @@ local get_attributes = function(object)
154154
add_extra_attributes[k](a, t)
155155
end
156156
is_poi = true
157-
break
158157
end
159158
end
160159

@@ -178,7 +177,7 @@ themepark:add_proc('node', function(object, data)
178177
if a then
179178
a.geom = object:as_point()
180179
themepark:insert('pois', a)
181-
data.in_pois = true
180+
data.shortbread_in_pois = true
182181
end
183182
end)
184183

@@ -187,7 +186,7 @@ themepark:add_proc('area', function(object, data)
187186
if a then
188187
a.geom = object:as_area():centroid()
189188
themepark:insert('pois', a)
190-
data.in_pois = true
189+
data.shortbread_in_pois = true
191190
end
192191
end)
193192

0 commit comments

Comments
 (0)