[fdo-users] Re : Re : Re : weird issue
Badreddine Karoui
badreddine.karoui at autodesk.com
Fri Mar 9 09:42:01 EST 2007
The issue related to float/string conversion is found in few places in the FDO and possibly MapGuide Open source. MapGuide server enforces setting the LC_NUMERIC to C. That will be true for at least the next milestone(1.2). There are some changes for other locale related issues addressed by this RFC: http://trac.osgeo.org/mapguide/wiki/MapGuideRfc18
The immediate solution to this issue would be to follow MapGuide Open source solution and to set the LC_NEMERIC to "C". That should be set once for the whole process and usually is done in the main function. In the case of MapGuide server, it's already done for you.
I'm aware that this solution will affect locale sensitive number formatting of your application. If that's the case, then you need to decide to either localize the LC_NUMERIC setting for your application or in the SHP provider as you indicated in your workaround. Re-setting the LC_NUMERIC may have some performance impact that you need to assess for your case and solution.
Badreddine
-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Ytse
Sent: Friday, March 09, 2007 9:34 AM
To: fdo-users at lists.osgeo.org; Ytse
Subject: [fdo-users] Re : Re : Re : weird issue
that would be enough for the GetData() method but I would have to rewrite the SetData() so that it doesn't use sprintf.
Anyway :
- GDAL1.3 released in FDO 3.2 ThirdParty doesn't contain cpl_strtod.cpp
- why use GDAL for that when we can simply set the locale to default (C language behavior) for the numeric values ?
my questions may sound (or even be :) stupid but please be indulgent as I'm no C++ programer
ytse
-----
The ESRI Shapefile doesn't say anything about handling data in with
locale-awareness or not.
In GDAL, there is locale independent function - CPLAtof - used in such
cases:
http://trac.osgeo.org/gdal/browser/trunk/gdal/port/cpl_strtod.cpp#L530
It should be enough to replace atof() with CPLAtof() call in FDO
provider for Shapefile.
Cheers
--
Mateusz Loskot
http://mateusz.loskot.net
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users
More information about the fdo-users
mailing list