问题
I receive coordinate of a vehicle and I need to find out the speed limit of that road at which this vehicle is at?. I know you can find maxspeed for a certain bounded box like this
www.overpass-api.de/api/xapi?[maxspeed=][bbox=5.6283473,50.5348043,5.6285261,50.534884]
but that is if this bounded box area has ONLY one speed limit. So say suppose there was an area which had two speed limit within the bounded box?
My second concern is how should i make the bounded box since I am just getting one co-ordinate at a time?
回答1:
Please don't ask more than a single question at once.
Your first question is not clear to me. The query will return all speed limits in the given bounding box, not just the first one.
Regarding your second question: You should use the around query instead of a bounding box. With around you can retrieve all elements within a certain radius around a given coordinate. Example query:
<query type="way">
<around lat="5.6283473" lon="50.5348043" radius="25"/>
<has-kv k="highway" v=""/>
<has-kv k="maxspeed" v=""/>
</query>
<print/>
Also see the language guide as well as overpass turbo for testing your queries.
来源:https://stackoverflow.com/questions/27259655/overpass-api-to-find-the-speed-limit-for-a-co-ordinate