Opened 14 years ago
Closed 14 years ago
#3775 closed defect (fixed)
mitab_spatialref.cpp - default GEOCS uses atof and has locale problems, fix proposed
Reported by: | nicolaslelong | Owned by: | aboudreault |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | OGR_SRS | Version: | 1.7.2 |
Severity: | normal | Keywords: | mitab |
Cc: | Daniel Morissette, aboudreault, warmerdam |
Description (last modified by )
In method TABFile::GetSpatialRef
, on line 1037, the following statement uses atof
to convert the SRS_UA_DEGREE_CONV string to double.
m_poSpatialRef->SetGeogCS( "unnamed", szDatumName, pszSpheroidName, dfSemiMajor, dfInvFlattening, pszPMName, dfPMOffset, SRS_UA_DEGREE, atof(SRS_UA_DEGREE_CONV));
This causes problems when the current locale has not "." as the decimal separator (results in 0 instead of 0.0174532925199433)
Fix ::
Simply replacing atof
with CPLAtof
solves the problem.
Change History (4)
comment:1 by , 14 years ago
Description: | modified (diff) |
---|
comment:2 by , 14 years ago
Cc: | added |
---|---|
Keywords: | mitab added |
comment:3 by , 14 years ago
Cc: | added |
---|---|
Owner: | changed from | to
I can take care of this one. There are many uses of atof in the code... but I don't think we have to convert everything to CPLAtof
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in mitab CVS (will be in mitab 2.0). The fix is in gdal svn trunk, synchronized with mitab CVS head in r20796.
The proposal seems reasonable to me. Daniel, who should do this?