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.

Community
  • 1
  • 1
Deep Shah
  • 1,334
  • 3
  • 20
  • 41
  • 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 Apr 04 '17 at 07: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 Apr 04 '17 at 09:57
  • @mmd Thanks for pointing out that factor . – Deep Shah Apr 04 '17 at 11:17
  • @Jendrusk so , do we have any other way to accomplish this ? – Deep Shah Apr 04 '17 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: https://github.com/plusCubed/velociraptor . Maybe worth considering before creating yet another maxspeed application. – mmd Apr 04 '17 at 17:57
  • @mmd thanks for sharing this app . I have tested it & it does not have speed data for Switzerland & many other areas of europe . After that I have installed Waze & it does have data so, any idea about how do they get those data ? – Deep Shah Apr 05 '17 at 12:59
  • @DeepShah: sorry, no idea where Waze gets its data from. If you plan to run your app on Overpass API (which essentially servers OpenStreetMap data) you will probably see the same data as through Velociraptor, which uses a very similar query (+/- different query radius) to what you mentioned in your question. – mmd Apr 05 '17 at 13:15

1 Answers1

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

scai
  • 20,297
  • 4
  • 56
  • 72
  • 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 Apr 04 '17 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 Apr 04 '17 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 Apr 04 '17 at 11:37
  • Yes, the coverage of the maxspeed tag will vary depending on the geographic region. – scai Apr 04 '17 at 11:53
  • so , there is no way to implement this app ? – Deep Shah Apr 04 '17 at 12:14
  • I don't know your requirements. There is no map that has maxspeeds for all roads. Hence there is no app that can return maxpseeds for all roads. How about just returning none or assuming a default maxspeed if you don't have a valid source available? – scai Apr 04 '17 at 12:21
  • better to display none as I have searched maxspeed limit in most of US states is as follows 70 mph for rural interstates, a 45 mph minimum speed limit, 65 mph for other 4 lane divided highways, and 55 mph for all other highways & there are chances of miscalculation in location so, these could be dangerous if we display maxspeed much higher than allowed on that road. – Deep Shah Apr 04 '17 at 12:28