@@ -382,6 +382,7 @@ function way_function()
382382 local write_name = false
383383 local construction = Find (" construction" )
384384 local is_highway_area = highway ~= " " and Find (" area" )== " yes" and is_closed
385+ local building_part = Find (" building:part" )
385386
386387 -- Miscellaneous preprocessing
387388 if Find (" disused" ) == " yes" then return end
@@ -645,7 +646,7 @@ function way_function()
645646 end
646647
647648 -- Set 'building' and associated
648- if building ~= " " then
649+ if building ~= " " or building_part ~= " " then
649650 Layer (" building" , true )
650651 SetBuildingHeightAttributes ()
651652 SetMinZoomByArea ()
@@ -868,17 +869,28 @@ end
868869
869870function SetBuildingHeightAttributes ()
870871 local height = tonumber (Find (" height" ), 10 )
872+ local buildingHeight = tonumber (Find (" building:height" ), 10 )
873+ local finalHeight = height or buildingHeight
874+
871875 local minHeight = tonumber (Find (" min_height" ), 10 )
872- local levels = tonumber (Find (" building:levels" ), 10 )
873- local minLevel = tonumber (Find (" building:min_level" ), 10 )
876+ local buildingMinHeight = tonumber (Find (" building:min_height" ), 10 )
877+ local finalMinHeight = minHeight or buildingMinHeight
878+
879+ local levels = tonumber (Find (" levels" ), 10 )
880+ local buildingLevels = tonumber (Find (" building:levels" ), 10 )
881+ local finalLevels = levels or buildingLevels
882+
883+ local minLevel = tonumber (Find (" min_level" ), 10 )
884+ local buildingMinLevel = tonumber (Find (" building:min_level" ), 10 )
885+ local finalMinLevel = minLevel or buildingMinLevel
874886
875887 local renderHeight = BUILDING_FLOOR_HEIGHT
876- if height or levels then
877- renderHeight = height or (levels * BUILDING_FLOOR_HEIGHT )
888+ if finalHeight or finalLevels then
889+ renderHeight = finalHeight or (finalLevels * BUILDING_FLOOR_HEIGHT )
878890 end
879891 local renderMinHeight = 0
880- if minHeight or minLevel then
881- renderMinHeight = minHeight or (minLevel * BUILDING_FLOOR_HEIGHT )
892+ if finalMinHeight or finalMinLevel then
893+ renderMinHeight = finalMinHeight or (finalMinLevel * BUILDING_FLOOR_HEIGHT )
882894 end
883895
884896 -- Fix upside-down buildings
0 commit comments