@@ -356,6 +356,7 @@ function way_function()
356
356
local housenumber = Find (" addr:housenumber" )
357
357
local write_name = false
358
358
local construction = Find (" construction" )
359
+ local building_part = Find (" building:part" )
359
360
360
361
-- Miscellaneous preprocessing
361
362
if Find (" disused" ) == " yes" then return end
@@ -568,7 +569,7 @@ function way_function()
568
569
end
569
570
570
571
-- Set 'building' and associated
571
- if building ~= " " then
572
+ if building ~= " " or building_part ~= " " then
572
573
Layer (" building" , true )
573
574
SetBuildingHeightAttributes ()
574
575
SetMinZoomByArea ()
@@ -773,17 +774,28 @@ end
773
774
774
775
function SetBuildingHeightAttributes ()
775
776
local height = tonumber (Find (" height" ), 10 )
777
+ local buildingHeight = tonumber (Find (" building:height" ), 10 )
778
+ local finalHeight = height or buildingHeight
779
+
776
780
local minHeight = tonumber (Find (" min_height" ), 10 )
777
- local levels = tonumber (Find (" building:levels" ), 10 )
778
- local minLevel = tonumber (Find (" building:min_level" ), 10 )
781
+ local buildingMinHeight = tonumber (Find (" building:min_height" ), 10 )
782
+ local finalMinHeight = minHeight or buildingMinHeight
783
+
784
+ local levels = tonumber (Find (" levels" ), 10 )
785
+ local buildingLevels = tonumber (Find (" building:levels" ), 10 )
786
+ local finalLevels = levels or buildingLevels
787
+
788
+ local minLevel = tonumber (Find (" min_level" ), 10 )
789
+ local buildingMinLevel = tonumber (Find (" building:min_level" ), 10 )
790
+ local finalMinLevel = minLevel or buildingMinLevel
779
791
780
792
local renderHeight = BUILDING_FLOOR_HEIGHT
781
- if height or levels then
782
- renderHeight = height or (levels * BUILDING_FLOOR_HEIGHT )
793
+ if finalHeight or finalLevels then
794
+ renderHeight = finalHeight or (finalLevels * BUILDING_FLOOR_HEIGHT )
783
795
end
784
796
local renderMinHeight = 0
785
- if minHeight or minLevel then
786
- renderMinHeight = minHeight or (minLevel * BUILDING_FLOOR_HEIGHT )
797
+ if finalMinHeight or finalMinLevel then
798
+ renderMinHeight = finalMinHeight or (finalMinLevel * BUILDING_FLOOR_HEIGHT )
787
799
end
788
800
789
801
-- Fix upside-down buildings
0 commit comments