-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KML export is generating decimal separators depending on system locale #15452
Comments
Author Name: Giovanni Manghi (@gioman) Tickets are tagged as blockers only if are regressions. Is this a regression since 1.7.4 (are you using 1.8, right?)? Did you tested make the conversion using the ogr2ogr cli tool? I'm not sure QGIS uses it to do this particular conversion, but if the issue surface also with ogr2ogr it may be not a qgis issue.
|
Author Name: Rodrigo Hjort (Rodrigo Hjort) Giovanni Manghi wrote:
I don't know. Yes, I'm on 1.8.0.
I've just tested ogr2ogr as you suggested. It generates proper KML files regardless the locales I set. All instructions below give binarily the same KML files: @ogr2ogr -f KML censo-ap1.kml 16SEE250GC_SIR.shp |
Author Name: Giovanni Manghi (@gioman) then is a qgis issue.
|
Author Name: Jürgen Fischer (@jef-n) Rodrigo Hjort wrote:
Not reproducable here. What's your platform and GDAL version? |
Author Name: Even Rouault (@rouault)
Setting LC_ALL isn't sufficient, as by default GDAL utilities will not call setlocale(), so it will not be taken into account. So you should try : "ogr2ogr -f KML censo-ap3.kml 16SEE250GC_SIR.shp --locale pt_BR.UTF-8" With recent GDAL versions (1.9 at least, perhaps older too), the code that exports the coordinates for KML, GML, WKT will replace the comma by decimal point. Note: there might be still issues with decimal points and non-C locale in other parts of GDAL/OGR however. Export of real values in DBF for example is known to be broken with non-C locale ( http://trac.osgeo.org/gdal/ticket/4713 ) Note 2: I've just discovered that a bug in in proj 4.7 hides some locale related problems, because it installs the C locale temporarily, but fails to restore the original locale properly. This has been fixed in proj 4.8 that restores properly the original locale, and now some locale related problems surface again |
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Jürgen Fischer (@jef-n) closed for the lack of feedback.
|
Author Name: François-Xavier Thomas (François-Xavier Thomas) I'm facing the exact same issue with QGIS 2.2 under Ubuntu 12.04. @Locale@ output on my system : @lang=fr_FR.UTF-8 Attached is a sample shapefile created from QGIS under the system locale, and its KML conversion from :
Both GDAL and QGIS under the C locale output a valid KML file, but QGIS using the system locale does not and uses comma as decimal separators. Additionally, for some reason which might be related, QGIS is unable to display the shapefile (not the KML file!) if opened under the system locale, but displays it perfectly well under the C locale. As far as I can tell, even though it was created under a french locale, the shapefile is valid, i.e. GDAL can open it under any locale. (It's the first time I'm around here, so forgive me if I shouldn't have reopened the ticket but created a new one instead)
|
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Andrey Isakov (@Andrey-VI) Same issue for me under Debian testing.
Related issue #17120 |
Author Name: Jürgen Fischer (@jef-n) Andrey Isakov wrote:
odd, still doesn't happen for me. fr_Fr, lv_LV, de_DE - all fine on unstable using GDAL/OGR 1.11.3.
|
Author Name: Giovanni Manghi (@gioman)
closing for lack of feedback. Please reopen if necessary.
|
Author Name: Rodrigo Hjort (Rodrigo Hjort)
Original Redmine Issue: 6110
Affected QGIS version: master
Redmine category:vectors
I'm using Quantum GIS on Linux with locales set to pt-BR (Brazilian Portuguese).
When I export to KML, it produces coordinates using "," decimal separator (according to pt-BR regionalization rules):
@-51,09189516,0,01566702 -51,091517879999998,0,01681002 -51,090230267830101,0,01554286575332 -51,089511609343091,0,014835625502677 -51,089524844693898,0,014785154452175 -51,089621934159901,0,014414918150888 -51,089695920000004,0,01413396 -51,090616079999997,0,01472103 -51,091445940477001,0,015334783410788 -51,09189516,0,01566702@
When I call Quantum GIS setting locales to en-US (i.e., by issuing "LC_ALL=C qgis"), proper values are set on KML file (by using "." and not "," as decimal separators):
@-51.09189516,0.01566702 -51.091517879999998,0.01681002 -51.090230267830101,0.01554286575332 -51.089511609343091,0.014835625502677 -51.089524844693898,0.014785154452175 -51.089621934159901,0.014414918150888 -51.089695919999997,0.01413396 -51.090616079999997,0.01472103 -51.091445940477001,0.015334783410789 -51.09189516,0.01566702@
In order to generate KML files, current system locale should be ignored.
Related issue(s): #17120 (relates)
Redmine related issue(s): 8332
The text was updated successfully, but these errors were encountered: