Re: Local rendering creates blank tiles



On 10.06.2010 01:08, Jiří Techet wrote:
On Wed, Jun 9, 2010 at 18:19, Pierre-Luc Beaudoin
<pierreluc beaudoin gmail com>  wrote:
On Jun 9, 2010, at 8:53 AM, Patrick Salecker wrote:
The only difference I noticed, was that the coordinates in the debug messages have points instead of commas.
That is a very common bug where the user's locale affects internal data format.  There is probably a conversion to a string somewhere and it should not be locale specific.
Yes, it appears to be something like this. And it's not libchamplain
bug but libmemphis bug at the end. I just put some traces and this is
the bounding box I get after the call of
memphis_map_get_bounding_box()

techy techy-laptop:~/Projects/libchamplain/demos$ ./local-rendering
left: 47, top: 8, right: 47, bottom: 8
techy techy-laptop:~/Projects/libchamplain/demos$ LANG= ./local-rendering
left: 47.6907, top: 8.62675, right: 47.7024, bottom: 8.64248

So it appears that libmemphis just loses the decimal part somewhere.
The reason why this bug doesn't appear with the libmemphis demo is
that the demo just doesn't call memphis_map_get_bounding_box().

Jiri
Thanks for you investigations. The bug is fixed in the Memphis trunk.

The XML parser uses sscanf to extract doubles from character arrays. sscanf's behavior is locale dependent. e.g. in German it expects a comma as decimal character and not a dot. I fixed it by resetting the locale to "C" in the parser, but IMHO the whole parser should use locale independent (and more secure) functions. Patches are welcome.

A new version of Memphis will be released in the next days.

Cheers,
Simon



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]