问题
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.
回答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
来源:https://stackoverflow.com/questions/43200612/how-to-get-maxspeed-allowed-for-latitude-longitude-with-certain-radius