I'm making calls to a local instance of the Overpass API to get all "roads" in a given bounding box. Weirdly all roads / paths / tracks seem to be classified under the "highway" key (isn't that a really bad name??). I'm interested only in roads that cars / buses can drive on, so I've identified a bunch (about 17) different highway values, and added them all as filters in my query string. That looks something like this :
"way[highway = motorway];
way[highway = trunk];
way[highway = primary];
way[highway = secondary];
way[highway = tertiary];
way[highway = unclassified];
way[highway = residential];
way[highway = service];
way[highway = motorway_link];
way[highway = trunk_link];
way[highway = primary_link];
way[highway = secondary_link];
way[highway = tertiary_link];
way[highway = living_street];
way[highway = bus_guideway];
way[highway = road];
way[highway = track]; "
The problem is, as far as I can tell, the response time seems to increase linearly with each added tag. Is there a smarter query that I can make which will speed up the response? It feels like there should be one tag that defines this type of way (I would have called it "road"), which would mean only one filter.
Just use one single regular expression instead:
way[highway~"^(motorway|trunk|primary|secondary|tertiary)$"];
And, of course: the current release 0.7.53 is recommended for best performance at the time of writing this.