[fdo-users] Re : Re : Re : weird issue

Badreddine Karoui badreddine.karoui at autodesk.com
Fri Mar 9 13:07:16 EST 2007


In that case setting the LC_NUMERIC in the constructor would work too.
The problem with that solution is that until FDO is fixed, you need to remember to make this change every time you get a new copy of the code.

Badreddine

-----Original Message-----
From: Ytse [mailto:bill_gfr at yahoo.fr] 
Sent: Friday, March 09, 2007 12:09 PM
To: Badreddine Karoui; fdo-users at lists.osgeo.org
Subject: Re : [fdo-users] Re : Re : Re : weird issue

Well my application is a .net managed one and it looks like the thread's culture doesn't transfer to the unmanaged part (I've tried to set it to en-US before looking in the c++ code and the result was still wrong).
That's why I was thinking about changing it in the SHP Provider sources, but as I'm not used to C++ object's lifecycle, I was wondering if setting it in SHPConnection's constructor would be enough (that's why I first tried to set it in the RowData constructor), if anyone can guide me on this.

Anyway, thank you a lot for your answer !

----- Message d'origine ----
De : Badreddine Karoui <badreddine.karoui at autodesk.com>
À : Ytse <bill_gfr at yahoo.fr>; fdo-users at lists.osgeo.org
Envoyé le : Vendredi, 9 Mars 2007, 15h42mn 01s
Objet : RE: [fdo-users] Re : Re : Re : weird issue


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


	

	
		
___________________________________________________________________________ 
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



More information about the fdo-users mailing list