[gdal-dev] Re: OFTReal values truncated to integer

2012-04-29 Thread diegogb
Uh, ok, I forgot to add () after the variable name: CPLLocaleC oLocaleCForcer(); For future readers, I also specify that this declaration must be placed *after* the "OGRRegisterAll();" line to take effect. For completeness, does anyone know how to do the same hack in Python code? Thank you all,

[gdal-dev] Re: OFTReal values truncated to integer

2012-04-28 Thread diegogb
If I include "gdal/cpl_conv.h", code completition works, but I get a compilation error: undefined reference to `CPLLocaleC::CPLLocaleC()' I searched in the source files of my GDAL library version (1.7.0) and the CPLLocaleC class definition exists. I'm sorry for asking again you help! My compilat

[gdal-dev] Re: OFTReal values truncated to integer

2012-04-28 Thread diegogb
Ok, I executed many tests and I found something strange. I tried: - QT Creator, - CodeLite, - Python I wrote the following programs; // C++ CodeLite version. #include "gdal/ogrsf_frmts.h" int main(int argc, char *argv[]) { OGRRegisterAll(); OGRSFDriver *driver = OGRSFDriverRegistrar::Ge

[gdal-dev] Re: OFTReal values truncated to integer

2012-04-27 Thread diegogb
In addiction to what I previously wrote, I noticed that the problem does not affect the x and y coordinates of the point. I'm using the last version of the Linux Mint OS. -- View this message in context: http://osgeo-org.1560.n6.nabble.com/OFTReal-values-truncated-to-integer-tp4933952p4935441.htm

[gdal-dev] Re: OFTReal values truncated to integer

2012-04-27 Thread diegogb
When I open the dbf file with LibreOffice Calc, the value of the Elev field is 1. *If I open the same file with GHex, the value, represented in ASCII, is "1,3"*, so I think that you're right and GDAL uses my local settings and writes reals using the comma to separate the decimal digits from the int

[gdal-dev] OFTReal values truncated to integer

2012-04-27 Thread diegogb
I have a problem on storing double values on shapefiles fields. If I execute this code: //... OGRFieldDefn zField("Elev", OFTReal); layer->CreateField(&zField); //... OGRFeature *pointFeature = OGRFeature::CreateFeature(layer->GetLayerDefn()); OGRPoint thePoint; thePoint.setX(1); thePoint.setY(1);