1

When downloading PBF files of Openstreetmap via Geofabrik, the file contains a field called "other_tags" which includes all the OSM tags for this feature. It is a String field and looks like "cycleway"=>"track","lit"=>"yes","maxspeed"=>"30","sidewalk"=>"both","source:maxspeed"=>"DE:zone30","surface"=>"asphalt".

I now want to create new columns for only some specific tags. Lets say "cycleway" and "maxspeed". I need to do this in QGIS.

  • 1
    The .pbf file should not have such a tag. I rather believe that you are reading OSM data through the GDAL OSM driver gdal.org/drivers/vector/osm.html. For saving the cycleway and maxspeed tags as separate attributes you should edit the osmconf.ini file. – user30184 Mar 20 '20 at 14:04
  • Thanks, then QGIS uses this driver when opening pbf files. Did not know that. You can add this as answer if you wish to. – MrXsquared Mar 20 '20 at 15:41
2

You can use the plugin QuickOSM for this purpose. After you have installed it, go to C:\Users\YourUsername\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\QuickOSM\resources\ogr\to_be_modified_osmconf.ini and open the .ini file with a suitable texteditor like Notepad++. Search for the line called attributes= within the desired geometry type and add your desired attributes separated by comma. For example: attributes=name,highway,waterway,aerialway,barrier,man_made,maxspeed,access,foot,vehicle,bicycle,tunnel,bridge. Save the file.

enter image description here

Now open QuickOSM and navigate to "OSM File". Choose your file to open, the desired geometry type and set your OSMConf file you have just modified. Click open. (If you did not create a new .ini file and just override the original file, there is no need to set it, because it is the default file).

enter image description here

The file will now load with the fields you have just specified and the associated values.

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.