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

Get road type and maximum speed for OSM way IDs

0

I am looking for a way to get the road type (e.g. highway or urban street) and the maximum allowed speed for OSM way IDs. I am dealing with a large set of data (~100,000 way IDs) in .csv format. I am trying to implement the data transfer via CURL command and get the result if possible in JSON format. I am completely new to the matter and would be really grateful for any help. I have already figured out that there are the OSM keys "highway=" and "maxspeed=" which might provide my required information. But I don't know how to use them via CURL or any other automatically working data transfer.

Many Thanks! John

asked 05 Dec '16, 19:50

john123's gravatar image

john123
21113
accept rate: 0%

edited 05 Dec '16, 20:03

How do you get the csv file? Converted from where?

(08 Dec '16, 10:27) Wetitpig0

2 Answers:

0

If you have an .osm/.o5m file in hand:

Use osmfilter

I am not sure what you are using, but create a nested for loop. The first loop searches by "maxspeed=x", with x as the speed, while the second loop searches by a loop with a switch-case function which includes all tag values of a highway.

answered 08 Dec '16, 10:41

Wetitpig0's gravatar image

Wetitpig0
307161928
accept rate: 10%

0

I don't know where you got the OSM way ID's from, but be aware that the ways can be deleted in the meantime. So not all IDs will return an answer

The following Overpass query gets the data for way 24777894 You could write a loop that makes http calls via curl for each of the IDs you have.

http://overpass.osm.rambler.ru/cgi/interpreter?data=%5Bout:json%5D;way(24777894);out;

answered 08 Dec '16, 16:40

escada's gravatar image

escada
19.0k16166302
accept rate: 21%