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

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.

permanent link

answered 08 Dec '16, 10:41

Wetitpig0's gravatar image

Wetitpig0
292151827
accept rate: 10%

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;

permanent link

answered 08 Dec '16, 16:40

escada's gravatar image

escada
17.6k16146278
accept rate: 21%

Your answer
toggle preview

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:

×132
×82
×40
×37
×2

question asked: 05 Dec '16, 19:50

question was seen: 1,251 times

last updated: 08 Dec '16, 16:40

powered by OSQA