[fdo-users] Re : Re : weird issue
Ytse
bill_gfr at yahoo.fr
Fri Mar 9 04:47:27 EST 2007
Ok, I've continued my investigations and found a way to get to the result I'm waiting for
To summarize the issue :
Providers\SHP\Src\ShpRead\RowData.cpp::GetData() method uses the atof() function that implicitely uses the current locale.
Providers\SHP\Src\ShpRead\RowData.cpp::SetData() method uses the sprintf() function that also implicitely uses the current locale.
But the shp files should be written using invariant culture (well, I don't know about the official specifications but considering how ArcView ord Excel can't read the decimal values using the french comma decimal separator, I guess that's it)
I've tried adding setlocale(LC_NUMERIC,"C"); in ::RowData (and back to default in ::~) and it works fine then
Could anyone confirm the SHP specifications ? If that's the way to go, could anyone define the best place to set/unset the locale ? (guess the row isn't the best place, maybe that should be done in ::ShpConnection)
Thank you
----- Message d'origine ----
De : Ytse <bill_gfr at yahoo.fr>
À : dan.stoica at autodesk.com
Cc : fdo-users at lists.osgeo.org
Envoyé le : Mercredi, 7 Mars 2007, 15h56mn 45s
Objet : Re : weird issue
Hum first of all, I'm not recieving mails from the mailing list any more, has something changed ??
I don't remember having ever marked this mail source as a spam and there's no trace of it in my spam box on yahoo
That's weird too :)
Back to my issue, you were saying :
"Hi, Haris is right, your precision and scale seem to be wrong (precision =9, scale=5). Dan."
The p20/s20 come from the managed Providers\SHP\Managed\UnitTest\ProviderTests\Updatetests.cs::create_schema() in FDO sources.
Anyway the issue is the same (loosing the decimals) even if I add only one property other than FeatId from this code sample (the code attached to my previous mail contained all properties but I've tested featid + each property one by one (featid + id, featid + street, featid +birthday) and the result is always the same, all the later read attempts will get numbers without their decimals parts until I restart the web service.
I'm really stucked with this and need your help.
I've also noticed that if I create a new SHP file and add decimal data into it, the DBF file will be written with the french decimal separator (comma) instead of a dot, which will make the SHP file invalid. This made me try something else :
if I edit the SHP file and replace the dots by commas (french decimal separator), it will be interpreted as decimals !
It behaves as if the SHP file is handled like a string (double.parse and double.tostring take the culture into account) instead of binary.
If anyone can try and help me with this, thanks
___________________________________________________________________________
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
___________________________________________________________________________
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