You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported by grisxa on 4 Sep 2009 01:17 UTC
As pj_init() calls pj_datum_set() that in turn calls locale-dependent atof() to convert, say, +towgs84 datum parameters, I suggest to reset LC_NUMERIC to "C" in beginning of pj_init() and get back on exit (see patch).
There is some more atof() in source tree, so maybe another steps should be taken to make proj.4 really locale-independent. See also http://trac.osgeo.org/proj/wiki/FAQ#DoesPROJ.4workindifferentinternationalnumericlocales
Comment by grisxa on 4 Sep 2009 13:18 UTC
I should also explain, how this bug happens.
Several multi-lingual applications, like QLandkarteGT, call pj_init() and pj_transform() internally. If projection is specified in form "+init=epsg:2393", file /usr/share/proj/epsg is parsed and datum parameters for 2393 are used. But they are stored with a dot as decimal point, while pj_init() already operates locale-specific decimal point (comma in my case). So atof() rounds float numbers to integers (it stops parsing at first dot met).
That is why I suggest to reset LC_NUMERIC.
As far as I can see, console utils from proj.4 don't have such issue, probably because they are not localized (don't use setlocale()).
Comment by warmerdam on 24 Sep 2009 02:14 UTC
I concur with your analysis and I have applied just a slight variation on the patch in trunk (a26eedd4 (SVN rev1630)).
Reported by grisxa on 4 Sep 2009 01:17 UTC
As pj_init() calls pj_datum_set() that in turn calls locale-dependent atof() to convert, say, +towgs84 datum parameters, I suggest to reset LC_NUMERIC to "C" in beginning of pj_init() and get back on exit (see patch).
There is some more atof() in source tree, so maybe another steps should be taken to make proj.4 really locale-independent. See also http://trac.osgeo.org/proj/wiki/FAQ#DoesPROJ.4workindifferentinternationalnumericlocales
Migrated-From: https://trac.osgeo.org/proj/ticket/49
The text was updated successfully, but these errors were encountered: