tilemaker icon indicating copy to clipboard operation
tilemaker copied to clipboard

Copying all original attributes

Open marsmathis opened this issue 11 months ago • 0 comments

Hi, is there an easy way of writing all original attributes of a given node or way into the corresponding vector tile object? I tried the following:

function way_function()
	local natural = Find("natural")
	if Find("natural") ~= "" and Find("natural") ~= "water" then
		Layer("natural", true)

		local tags = AllTags(natural)

		local max_keys = 200 -- Safety limit to avoid exceeding the Lua table limit
		local count = 0

		for key, value in pairs(tags) do
			Attribute(key, value)
			count = count + 1

			if count >= max_keys then
				break -- Stop adding attributes when reaching the limit
			end
		end
	end
end

This fails thusly:

lua runtime error 2:
more than 512 unique keys
table  `more than 512 unique keys'  `more than 512 unique keys'  
Lua error on relation 915415

Am I doing something wrong?

marsmathis avatar Feb 07 '25 12:02 marsmathis