[Qgis-user] QGIS 2.0 and reading OSM through GDAL

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Thu Sep 26 14:22:26 PDT 2013


Hi,

I ask this because I am on 32-bit Windows and therefore my QGIS 2.0 comes
with GDAL 1.9 and I can't test myself yet.

Question is: How well QGIS 2.0 supports reading OSM data with the GDAL
read-only OSM driver http://www.gdal.org/ogr/drv_osm.html?

The driver is fast with medium sized datasets. It takes 3 minutes to convert
everything from a Finnish OSM data (150 MB as .pbf) into Spatialite
database. GDAL driver creates 5 OGR layers from the OSM data and reading
them as is may not make much sense with QGIS but with some query wizard
users could select a subset of OSM data and convert those into normal GIS
layers in QGIS. The wizard might help users by creating a list of columns
which can be used for quories by parsing the "osmconf.ini" file. Then there
should be an editable SQL query box for the final query. The contents of the
box would be converted into GDAL/OGR SQL clause. The result would be
something similar than this ogr2ogr command which selects all lines with any
highway tag from an OSM file and saves them into shapefile.

ogr2ogr -f "ESRI Shapefile" -dialect sqlite -sql "select * from lines where
highway is not null" highways.shp berlin-latest.osm.pbf

Once I have QGIS with GDAL 1.10 I can myself do this kind of things by
writing GDAL .vrt files which would take care of the SQL part but I guess
many other users would appreciate to have a wizard.

-Jukka Rahkonen-




More information about the Qgis-user mailing list