Skip to content

Commit e7f3ee5

Browse files
committed
Add streets_polygons_labels to shortbread
This is a layer in the schema that was not previously implemented.
1 parent 5ec44a5 commit e7f3ee5

File tree

2 files changed

+41
-4
lines changed

2 files changed

+41
-4
lines changed

themes/shortbread_v1/topics/streets.lua

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,18 @@ themepark:add_table{
144144
},
145145
}
146146

147+
themepark:add_table{
148+
name = 'streets_polygons_labels',
149+
ids_type = 'area',
150+
geom = 'point',
151+
columns = themepark:columns('core/name', {
152+
{ column = 'kind', type = 'text', not_null = true },
153+
}),
154+
tiles = {
155+
minzoom = 11
156+
},
157+
}
158+
147159
themepark:add_table{
148160
name = 'streets_labels_points',
149161
ids_type = 'node',
@@ -278,8 +290,15 @@ local process_as_area = function(object, data)
278290

279291
a.geom = object:as_polygon()
280292

281-
themepark.themes.core.add_name(a, object)
282-
themepark:insert('street_polygons', a, t)
293+
294+
if themepark.themes.core.add_name(a, object) then
295+
local g = a.geom:transform(3857)
296+
themepark:insert('street_polygons', a, t)
297+
a.geom = g:pole_of_inaccessibility()
298+
themepark:insert('streets_polygons_labels', a, t)
299+
else
300+
themepark:insert('street_polygons', a, t)
301+
end
283302
end
284303

285304
themepark:add_proc('way', function(object, data)

themes/shortbread_v1_gen/topics/streets.lua

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,18 @@ themepark:add_table{
181181
},
182182
}
183183

184+
themepark:add_table{
185+
name = 'streets_polygons_labels',
186+
ids_type = 'area',
187+
geom = 'point',
188+
columns = themepark:columns('core/name', {
189+
{ column = 'kind', type = 'text', not_null = true },
190+
}),
191+
tiles = {
192+
minzoom = 11
193+
},
194+
}
195+
184196
themepark:add_table{
185197
name = 'streets_labels_points',
186198
ids_type = 'node',
@@ -315,8 +327,14 @@ local process_as_area = function(object, data)
315327

316328
a.geom = object:as_polygon()
317329

318-
themepark.themes.core.add_name(a, object)
319-
themepark:insert('street_polygons', a, t)
330+
if themepark.themes.core.add_name(a, object) then
331+
local g = a.geom:transform(3857)
332+
themepark:insert('street_polygons', a, t)
333+
a.geom = g:pole_of_inaccessibility()
334+
themepark:insert('streets_polygons_labels', a, t)
335+
else
336+
themepark:insert('street_polygons', a, t)
337+
end
320338
end
321339

322340
themepark:add_proc('way', function(object, data)

0 commit comments

Comments
 (0)