14

.osm.pbf it`s the extension for OpenStreetMap extract that I get from a site that takes daily extracts from osm: http://download.geofabrik.de/

How to import these files in QGIS? On Linux or Windows? The more simplest variant, if it exists.

16

QGIS is now able to read .pbf files with Add vector layer, but the data size will most probably kill QGIS with most of the available files.

Try ogr2ogr -f SQLite my.sqlite some.pbf in the OSGEO4W shell to convert the pbf into a spatialite database, and connect to that in QGIS.

You might want to switch to the data folder or use full paths to access the files.

  • 1
    This is the way I do it. The ogr configuration file osmconf.ini can be edited to select or deselect the OSM keys that will be reported as fields in the database. – nhopton Dec 3 '14 at 9:11
  • 1
    What can i do if i get this errors, during the conversion C:\Users\florinb\Downloads>ogr2ogr -f SQlite canada.sqlite canada-latest.osm.p Warning 1: organizePolygons() received an unexpected geometry. Either a polygon with interior rings, or a polygon with less than 4 points, or a non-Polygon geometry. Return arguments as a collection. Warning 1: organizePolygons() received an unexpected geometry. When i try to open the file in Qgis, i get a generic erro r message "Unexpected error when working with: C:/Users/florinb/Downloads/canada.sqlite " – Badita Florin Jun 4 '15 at 6:50
  • 2
    @BaditaFlorin I think this is worth a new question. – AndreJ Jun 4 '15 at 14:43
3

the openstreetmap plugin (current version 0.5) only reads osm-files , but there is a commandline-convert (both for linux as well as for windows. I only tried windows), which can convert *.pbf to *.osm. these converted osm can be importet into qgis via openstreetmapplugin

url for converter: http://wiki.openstreetmap.org/wiki/Osmconvert

1

You can also get the shapefile versions of the extracts. That way you won't have to convert anything. enter image description here

  • 5
    Please consider that the provided shapefiles only have a subset of the whole OSM data of the area. If you are interested in very special data, you have to fill the complete OSM data into a PostgreSQL database. – AndreJ Nov 2 '12 at 5:49
  • 1
    Looking a few years later, I'll confirm that there's also a problem with these extracts for features that cross borders. For example, the Ottawa River is omitted (rather than split) where it straddles the border between the Canadian provinces of Ontario and Quebec, and the St. Lawrence River is omitted where it straddles the Canada/US border. – Canuck Dec 22 '16 at 2:18

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.