3

I used this tutorial by underdark (thanks much :-) ) to convert my area of interest from OSM file (whole Czech Republic downloaded from Geofabrik.de server). Used OSGEO4W shell (saying "GDAL 1.11.0, released 2014/04/16") and following command:

C:\GIS\CZ_OSM_data_2014-07-22T20-21-02>ogr2ogr -f "SQLite" -dsco SPATIALITE=YES -spat 12.50004 50.46600 12.93001 50.15486 nejdek_OSM_2014_07.db czech-republic-l atest.osm.pbf

I loaded the exported DB in QGIS and found out that the places labels are not displayed correctly in QGIS 2.4.0-Chugiak (GDAL/OGR 1.11.0, SpatiaLite 4.1.1) running on Windows 7 64bit while the same project is ok when opened in 2.4.0-Chugiak (GDAL/OGR 1.10.0, SpatiaLite 4.1.1) running on 32bit Kubuntu linux on my laptop.

Tried to find and encoding settings or something similar but no success...

Any advice or idea what am I doing wrong?

3

Ok, found at least one working solution. After finding that on Linux everything is fine suspected the default encoding in Windows. So I opened the QGIS project file (*.qgs) in PSPad and found this in layer description:

<provider encoding="System">ogr</provider>

So probably QGIS uses CP1250 encoding as default in Windows while the database is (I think) in UTF-8. To test this I used a copy of the QGS file and replaced the above mentioned with:

 <provider encoding="UTF-8">ogr</provider>

And the project opens correctly on Windows too. Recommend to use PSPad, Bluefish or some other advanced text editor to be sure not to damage the file and work with a copy, of course.

Hope this helps :-)

2

I get the same nasty effect if I load the data with Add vector layer using the ogr driver:

        <provider encoding="System">ogr</provider>

Alternatively (and the preferred way) I can load the data with Add spatialite layer. The encoding line changes to:

        <provider encoding="System">spatialite</provider>

which is wrong too, but qgis ignores it and uses utf-8 as default for spatialite. The attribute table looks ok with that.

Unlike other data providers like shapefiles allow, the encoding can not be changed within the GUI. In Properties, General tab the encoding field is empty.

I think this is worth a bug report.

  • ok, reported as a bug hub.qgis.org/issues/10944 – Juhele Jul 24 '14 at 13:37
  • Can you add to your ticket how you load the spatialite layer into QGIS? – AndreJ Jul 24 '14 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.