@@ -356,6 +356,7 @@ function way_function()
356356 local housenumber = Find (" addr:housenumber" )
357357 local write_name = false
358358 local construction = Find (" construction" )
359+ local building_part = Find (" building:part" )
359360
360361 -- Miscellaneous preprocessing
361362 if Find (" disused" ) == " yes" then return end
@@ -568,7 +569,7 @@ function way_function()
568569 end
569570
570571 -- Set 'building' and associated
571- if building ~= " " then
572+ if building ~= " " or building_part ~= " " then
572573 Layer (" building" , true )
573574 SetBuildingHeightAttributes ()
574575 SetMinZoomByArea ()
@@ -773,17 +774,28 @@ end
773774
774775function SetBuildingHeightAttributes ()
775776 local height = tonumber (Find (" height" ), 10 )
777+ local buildingHeight = tonumber (Find (" building:height" ), 10 )
778+ local finalHeight = height or buildingHeight
779+
776780 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
779791
780792 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 )
783795 end
784796 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 )
787799 end
788800
789801 -- Fix upside-down buildings
0 commit comments