This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

Export roads with maxspeed

0

Hi!

I need to export all roads in the netherlands together with their maxspeed. I exported the osm.pbf file through geofabrik.de and imported this in postgresql with osm2psql. However, this data does not contain the maxspeed attribute, is there a method to extract all roads together with their maxspeed value for a particular country?

Thanks!

asked 26 Nov '20, 13:37

faster043's gravatar image

faster043
21112
accept rate: 0%


One Answer:

2

Your approach is good. You need to modify osm2pgsql's ".style" file to include a maxspeed column (maxspeed is not required for rendering hence is not part of the default schema) or alternatively use the --hstore option on import which will put all tags into a special "tags" column, and then you'll get the data you are looking for.

(If you're modifying the .style file, you can also throw away anything not related to roads - that will speed up your import and waste less space.)

answered 26 Nov '20, 14:29

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thanks! Hstore did it for me

(26 Nov '20, 15:17) faster043