Ticket #869 (reopened defect)
OGRSpatialReference::exportToProj4 is not locale-safe
| Reported by: | ge@… | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | OGR_SRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
When calling exportToProj4 after calling setlocale, it will return commas instead of points in numbers, which will confuse proj4. Possible fixes: - Make proj4 locale-aware; this would probably break many scripts that don't care about locales - Don't use sprintf in exportToProj4; this would be a hell lot of work, as all formatting is done using sprintf... - Call setlocale before and after exportToProj4; hacky and since setlocale can be expected not to be thread-safe, this would be counterproductive to the current multi-threading efforts Test case: from osr import * import locale locale.setlocale(locale.LC_ALL, '') srs = SpatialReference() srs.ImportFromEPSG(31297) print srs.ExportToProj4() # Run with LANG=de or something equivalent and watch the commas...
Change History
Note: See
TracTickets for help on using
tickets.
