Why not ask your question on the new OpenStreetMap Community Forum?


I am using OSM for my project, I have downloaded data from http://download.geofabrik.de/ in the OSM file and imported the data in POSTGIS, In the planet_osm_roads, I am not able to see any key realted to lanes.

Can you please help me get the information about the number of lanes from OSM?

asked 15 May '19, 18:54

gautamshahi's gravatar image

accept rate: 0%

By default osm2pgsql will not create a "lanes" column. You can either provide a modified .style file that contains the "lanes" attribute when running osm2pgsl (with the -S option), or you can run osm2pgsql with the --hstore option which will result in a "tags" column that has all tags that don't have extra columns to themselves. You will then be able to access the lanes tag with the syntax tags->'lanes' in your SQL query.

Of course, less than 10% of all highway objects in OSM have a lane tag so you won't find it everywhere.

permanent link

answered 15 May '19, 21:07

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 15 May '19, 18:54

question was seen: 2,321 times

last updated: 15 May '19, 21:07

powered by OSQA