NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello,

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

gautamshahi
11112
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 ♦
82.5k927201273
accept rate: 23%

Follow this question

By Email:

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

By RSS:

Answers

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:

×710
×263
×134

question asked: 15 May '19, 18:54

question was seen: 2,932 times

last updated: 15 May '19, 21:07

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum