0

I'm developing android app which has a functionality to display maxspeed allowed for current location (in other words latitude & longitude). I have came across this solution Query Overpass turbo by latitude longitude which gives maxspeed value for location using overpass turbo but it is not working for all locations. I have created JSON request https://overpass-api.de/api/interpreter?data=[out:json];way[maxspeed](around:1.0,52.004940, 4.369381);out tags; using query & it returns max speed tag within json data but it is not working for all locations .

Here is example of blank data i got from these url : Blank data

Any help would be appreciated . This app is going to be launched in US & Europe so, if solution is specific to these locations also welcome. But hope for generic solution.

7
  • 2
    For your query overpass-turbo is returning tags for a linestring having maxspeed - maybe there is no such line in this buffer? This is OSM Data - maxspeed doesn't have to be present on every highway...
    – Jendrusk
    Commented Apr 4, 2017 at 7:22
  • 2
    Side note: you're required to adhere to the Overpass API usage limit as per OSM wiki. There's a maximum number of 10'000 requests in total per day for ALL of your app users in total. If you're expecting to exceed this limit, be sure to install your own instance, otherwise your app might be blocked without prior notice.Also be sure to send a meaningful User Agent in the HTTP header to identify yourself / your app.
    – mmd
    Commented Apr 4, 2017 at 9:57
  • @mmd Thanks for pointing out that factor .
    – Deep Shah
    Commented Apr 4, 2017 at 11:17
  • @Jendrusk so , do we have any other way to accomplish this ?
    – Deep Shah
    Commented Apr 4, 2017 at 11:20
  • Just another comment: there are already quite a number of apps out there doing exaxtly the same thing as you described. As an example for a GPLv3 licensed app: github.com/plusCubed/velociraptor . Maybe worth considering before creating yet another maxspeed application.
    – mmd
    Commented Apr 4, 2017 at 17:57

1 Answer 1

1

There isn't even a single way at lat 46.361115, lon 6.13975 within a radius of 1 meter: https://www.openstreetmap.org/?mlat=46.361115&mlon=6.13975#map=19/46.36111/6.13975

Either change your coordinates or increase the search radius.

Also as user Jendrusk already noted not every street has a maxspeed in OSM set. The city Divonne-les-Bains from your example has only few roads with a maxspeed tag: http://overpass-turbo.eu/s/o48

7
  • I have increased radius upto 100 meters still returning blank data . Can you suggest me better approach for my app? App has simple requirement to speak speed limit of current driving road .
    – Deep Shah
    Commented Apr 4, 2017 at 11:23
  • See the overpass-turbo link in my answer. There are only very few maxspeed tags for your area. Unfortunately OSM doesn't have this information for this city.
    – scai
    Commented Apr 4, 2017 at 11:24
  • Okay , I saw that unfortunately very less amount of information available . It fails the purpose of my app driver won't be able to know speed limit for certain areas & also these will occur for many other locations , right ?
    – Deep Shah
    Commented Apr 4, 2017 at 11:37
  • Yes, the coverage of the maxspeed tag will vary depending on the geographic region.
    – scai
    Commented Apr 4, 2017 at 11:53
  • so , there is no way to implement this app ?
    – Deep Shah
    Commented Apr 4, 2017 at 12:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.