More

Converting tags in OpenStreetMap (OSM) files to attribution in shapefiles?

Converting tags in OpenStreetMap (OSM) files to attribution in shapefiles?


I've downloaded the street data from OpenStreetMap (OSM). I'm looking for speed limit attribution and OSM seems to be the only source for my jurisdiction (Ontario, Canada). The problem is, the speed is stored as a 'tag' and when I download the .osm file and convert it to .shp using geoconverter, it stores all the tags into a single attribute. For example, the field "other_tags" wil contain: "hgv"=>"no","lanes"=>"3","maxspeed"=>"50","old_ref"=>"48","oneway"=>"yes","surface"=>"asphalt"

I just want maxspeed and maybe lanes

I have next to no programming skills. With that in mind, does anyone know how I can do this?


Geoconverter seems to be using GDAL but unfortunately you can't edit it's configuration.

GDAL OSM driver is using a configuration file "osmconf.ini" for setting which tags will be converted into normal attributes http://www.gdal.org/drv_osm.html. You must install GDAL locally and edit the osmconf.ini file which by default has these settings for lines:

[lines] # common attributes osm_id=yes osm_version=no osm_timestamp=no osm_uid=no osm_user=no osm_changeset=no # keys to report as OGR fields attributes=name,highway,waterway,aerialway,barrier,man_made

All you need to do is to add maxpeed into the list of attributes, and to learn how to use ogr2ogr http://www.gdal.org/ogr2ogr.html.