From 206362c47c2e1f22db8fb21916352aca4b36b08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Etil=C3=A8ne=20Jourdier?= Date: Mon, 10 Nov 2025 21:32:57 +0100 Subject: [PATCH] handle numeric values of layer and level tags with math.floor --- resources/process-openmaptiles.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/process-openmaptiles.lua b/resources/process-openmaptiles.lua index 3158bfba..501522cc 100644 --- a/resources/process-openmaptiles.lua +++ b/resources/process-openmaptiles.lua @@ -314,7 +314,8 @@ function write_to_transportation_layer(minzoom, highway_class, subclass, ramp, s if subclass and subclass ~= "" then Attribute("subclass", subclass) end - AttributeInteger("layer", tonumber(Find("layer")) or 0, accessMinzoom) + local layer = tonumber(Find("layer")) or 0 + AttributeInteger("layer", math.floor(layer), accessMinzoom) SetBrunnelAttributes() -- We do not write any other attributes for areas. if is_area then @@ -755,13 +756,14 @@ function WritePOI(class,subclass,rank) Attribute("class", class) Attribute("subclass", subclass) -- layer defaults to 0 - AttributeInteger("layer", tonumber(Find("layer")) or 0) + local layer = tonumber(Find("layer")) or 0 + AttributeInteger("layer", math.floor(layer)) -- indoor defaults to false AttributeBoolean("indoor", (Find("indoor") == "yes")) -- level has no default local level = tonumber(Find("level")) if level then - AttributeInteger("level", level) + AttributeInteger("level", math.floor(level)) end end