1

I want to query highways with Overpass to calculate routes with Graphhopper. With some trial and error I came to the following query and it seems to work (tested in overpass turbo):

(
  ._;
  way[highway]({{bbox}});
  node(w);
);
out;

I still have trouble understanding what exactly the query does, especially the default set ._;. Is it actually redundant here?

Also, I really only need to calculate routes for pedestrians and cyclists. What would be the best approach there? Expanding the query above with filters or just limit the vehicle in Graphhopper?

  • 1
    ._ is explained in more detail here: wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Item - it’s not needed in your case. Also add additional tag filters as needed rather than querying for all highways. – mmd Feb 20 '18 at 22:01
  • @mmd I read that part, but I still didn't understand how to use ._. But thanks for confirming that it is redundant in my query. – Tao Feb 20 '18 at 22:05
  • There are several examples on how to use ._ on the Overpass QL by Example page: wiki.openstreetmap.org/wiki/Overpass_API/… - does that help? – mmd Feb 21 '18 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.