I need to obtain the name and maxspeed given the node id.
I can obtain that using the latitude and longitude, but I don’t know how do this using a node id. Example:
https://overpass-api.de/api/interpreter?data=[out:json];way[maxspeed](around:5.0,36.6870970,-4.4531804);out%20center;
Output
{
"version": 0.6,
"generator": "Overpass API 0.7.61.5 4133829e",
"osm3s": {
"timestamp_osm_base": "2023-10-13T14:02:30Z",
"copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
},
"elements": [
{
"type": "way",
"id": 60727865,
"center": {
"lat": 36.6880970,
"lon": -4.4541804
},
"nodes": [
746325927,
3650408717,
7067178413,
3547298108,
3650408715,
760219855,
5245547649,
5417047626,
3650408712,
760219851
],
"tags": {
"cycleway:right": "shared_lane",
"highway": "primary",
"lanes": "2",
"lit": "yes",
**"maxspeed": "50",**
"name": "Avenida Molière",
"oneway": "yes",
"parking:right:orientation": "diagonal",
"sidewalk": "right",
"surface": "asphalt"
}
}
]
}
The sense is that I can obtain the nodes using the /nearest/ query of the OSRM API. The idea is obtain the nearest point and its node id, and the attack Overpass API with the node id to obtain the maxpspeed information.
Solved
https://overpass-api.de/api/interpreter?data=[out:json];node(id:5417047626);out;
This better:
https://overpass-api.de/api/interpreter?data=[out:json];node(id:5417047626);way(bn);out geom;