问题
Is there any way to connect to the web server of OpenStreetMap?
I want to receive the speed limit information given a geoLoc "lat and Lon". I thought of solving this issue by creating a huge database encompases the node's lat and lon and the speed limit and then query the speed limit given a specific geoLoc.
but now i am wondering is it possible to connect directly the OSM server and query the speed limit given a specific geoLoc?! whic approach is more efficient?
回答1:
You can use Overpass API for querying (almost) any information. The language guide even has a very similar problem to yours: querying for name and rough location. Just replace the name tag with the maxspeed tag and you are almost done.
Overpass API has a really powerful language which can be quite a bit confusing at first. It might help you running your queries via the overpass turbo frontend which has a nice visualization of the results.
来源:https://stackoverflow.com/questions/34203228/how-to-query-osm-from-the-server