Skip to content

Conversation

@etienneJr
Copy link
Contributor

While calculating tiles for cartes.app, @laem and I noticed that numeric but non integer layer or level values make the calculation to crash, for example with this message :

Block 549/3727 lua runtime error 2:
maybe...Argument mismatch:string,number	 candidate is:
		std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,int,
		std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,int,char,

stack traceback:
	[C]: in function 'AttributeInteger'
	./resources/process-openmaptiles.lua:764: in function 'WritePOI'
	./resources/process-openmaptiles.lua:199: in function 'node_function'
table  `maybe...Argument mismatch:string,number	 candidate is:
		std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,int,
		std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,int,char,

stack traceback:
	[C]: in function 'AttributeInteger'
	./resources/process-openmaptiles.lua:764: in function 'WritePOI'
	./resources/process-openmaptiles.lua:199: in function 'node_function''  `maybe...Argument mismatch:string,number	 candidate is:
		std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,int,
		std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,int,char,

stack traceback:
	[C]: in function 'AttributeInteger'
	./resources/process-openmaptiles.lua:764: in function 'WritePOI'
	./resources/process-openmaptiles.lua:199: in function 'node_function'
stack traceback:'  
Lua error on node 676795020
Block 552/3727 Erreur de segmentation (core dumped)

It happens for example on these elements:

This PR fixes this bug using math.floor which is not perfect, but I did not find a round function in Lua ?

@systemed systemed merged commit 9ae6a27 into systemed:master Nov 14, 2025
1 of 7 checks passed
@systemed
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants