I have compiled a local instance of the overpass api, because I need to make a lot of "around" queries (over 6 million). The solution I'm using right now is to call bin/osm3s_query for every single query. This is very slow, because osm3s_query has to start, answer the query and shut down for every single query.

The solution in Query one overpass api process multiple times (which question is very similar to mine but not the same) suggest just grabbing the bounding box and then searching the return value of that, but for "around" queries that doesn't help because I have no perfect matches for the GPS coordinates that gets me. Is there a way to submit multiple queries to the overpass API? Or should I be using something else entirely?

edit: it currently takes a little under half a second to get a single point. Even if I cut down my dataset an order of magnitude that's still 3.5 days non-stop.

  • Can you check if openstreetmap.org/user/mmd/diary/42055 matches your use case? Can you reduce the number of gps coordinates which are close by?
    – mmd
    May 12, 2018 at 10:43
  • If I understand you correctly, you have done an "around" query on a series of coordinates; I've tried that query on overpass turbo, and it looks to me that you do indeed get all points around that track for a given radius, but no information on what point in the input corresponds with "way" nodes in the output, so I still wouldn't know for an individual coordinate on what road they were.
    – retorquere
    May 12, 2018 at 11:13
  • It is in principle possible to reduce the number of points (I could take the haversine between consecutive points and assume road type doesn't change within 10 meters or so) and that would cut it down an order of magnitude, but that still expensive to do, and I'd prefer to get the whole dataset if at all possible.
    – retorquere
    May 12, 2018 at 11:16

1 Answer 1


I've managed to set up OSRM with a custom "WayHandlers.names" in the osrm-extract phase that puts the road type and maxspeed in the road "name"; a /nearest/v1/driving query returns the results I need in about 4.2ms. That's still 5 hours or so, but that's acceptable for me.

  • Is your custom "WayHandlers.names" available somewhere? It doesn't seem to be on your github (assuming you have the same nick there)? My problem seem vaguely related to your question here and on github github.com/Project-OSRM/osrm-backend/issues/5124 (I am interested first in mayspeed along a route, later also in maxspeed for side roads) Jan 1, 2022 at 21:18
  • 1
    Same nick, correct, but I no longer have access to the source for that, sorry. Wish I could help you.
    – retorquere
    Jan 2, 2022 at 22:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.