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

0
1

I'm trying to get the ways around me using this API query: (overpass-turbo.au)

<query type="way">
    <around lat="52.002362" lon="-1.271373" radius="20"/>
 <has-kv k="highway"/>
</query>
<union>  <item/>
  <recurse type="down"/>
</union>
<print/>

Its returns data but i want to get more nodes, in this example more of road M40 so I can reduce the API calls. is it possible using this query with other parameters or by query for the specific road (M40) by another API call?

Thnak's

asked 22 Oct '17, 10:39

alto's gravatar image

alto
11113
accept rate: 0%

1

Is there any reason you're looking for an API for this? Why not just download the data that you are interested in, load it into a database and query that?

(23 Oct '17, 12:19) SomeoneElse ♦

I'm working on a POC application that need to know ahead the road I'm on it. The DB can't be downloaded to the mobile device - too big. For now I'm using the public (overpass-turbo.au) API server, but in the moment it will work, I'll use my own servers for that of course.

(23 Oct '17, 12:22) alto

Can't the mobile app contact an app server of yours? Then it can do any query it wants and not be limited by a third-party API (which you presumably don't have an SLA for).

(23 Oct '17, 12:35) SomeoneElse ♦

Sure, that the plan, after I'll see that it's working. For now it's simple to work with the public API servers than build my own servers. Time to market and proof of concept first :)

(23 Oct '17, 12:38) alto
2

Just be careful you don't get into https://xkcd.com/1150/ territory :)

(23 Oct '17, 12:41) SomeoneElse ♦
1

@alto: what do you think of apps such as OsmAnd, maps.me, Magic Earth, etc. They all put a database on a mobile device. That database contains streets, addresses, POIs, opening hours, etc. and information to render, navigate and search. They do not put the whole world on your device, but allow you to download the country/state/provinces of interest. No need to pay for mobile data.

(24 Oct '17, 04:49) escada

@escada: totally correct, I even uses some of them but as I said, for now I'm working on POC project only, it's easier to work for now with public API. in the feature, if this project will became something 'real', we'll have to decide how to set/get the data, I assume that its will be online also, but from our servers, since the all app needs to be online and it's a lot of data to download if you don't know the exact area you going to be on and you have to remember to do it before going there...

Its all depend on the usage and business model of the app.

(24 Oct '17, 10:16) alto
showing 5 of 7 show 2 more comments

After looking more into the api: Its shame there is no straight way to get the all parts of the road by some part of it, it's will be much easier. I found a way to do it, but with some work:

  1. query again the overpass api by the name & ref that I get from the first query, e.g: http://overpass-api.de/api/interpreter?data=[out:json][timeout:25];(node["name"="John F Foran Freeway"]["ref"="I 280"];way["name"="John F Foran Freeway"]["ref"="I 280"];relation["name"="John F Foran Freeway"]["ref"="I 280"];);out;>;out skel qt;
  2. get all way nodes from the result json and merge them to one list of points, need some work since you need to pass each of the items and find the next one by compare each the last and the first points.
permanent link

answered 23 Oct '17, 11:55

alto's gravatar image

alto
11113
accept rate: 0%

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:

×483
×290
×167

question asked: 22 Oct '17, 10:39

question was seen: 2,089 times

last updated: 24 Oct '17, 10:16

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