Overpass Street Query

There have been a few mentions/discussions of the query I use to collect the streets from Overpass API, so it seems like a good idea to open a thread that solely discusses this.

This Google Doc - CityStrides Street Query - contains a full list of road types and the full/explained query that CityStrides currently uses.

We can use this thread to discuss what should/shouldn’t be excluded in CityStrides or otherwise improve the query.

I suggest adding

[‘highway’ !~ ‘bus_stop’]


[‘public_transport’ !~ ‘platform’]

See https://www.openstreetmap.org/node/6654529717#map=19/52.34611/4.91843

Good one putting in in this separate thread.I noticed after the osm refresh, that a lot of highways here have cycle = no, but not foot = no. That was a lot of manual work for me in OSM (And the changes should be apparent in the next OSM update in a few months) :slight_smile: Maybe you could consider to put cycle = no in the excluding script part. Since a path allowed for cycling ==walking/running?
At least for the time being, if i am sure a node in citystrides is private, not correct or whatever reason not to run as a citystreet, i personally put them on manually completed after changing OSM itself. The manually completed streets on my name should go away after future updates.

Another one I think:
[‘access’ !~ ‘customers’]

E.g. https://www.openstreetmap.org/way/672426568

This is a railway station that you can only enter with a valid ticket/card.

Would it be possible for you to share a link to the CityStrides page for these bad streets as well?


https://citystrides.com/streets/9197599 : This seems to be a ‘street’ composed of bus stops near the train station.

https://citystrides.com/streets/9197600 : This passage is only accessible for customers

1 Like

In order to make this process a bit more systematic, I’ve taken the liberty to compile a list of all possible highway and access values. I have also included a column indicating whether or not they should be excluded from the query.

It would be great if someone could have a look and check if I missed (or wrongly included) anything that should be excluded. The sheet is here, please add a comment if you edit anything, thanks!


This is outstanding - thank you!

I added the file to My Drive, then changed the name to “CityStrides Street Query” & tightened up the columns/rows. I’ve also added another Sheet with the full query, including comments on what each line does - this way we can collectively improve it. :+1:

Are those changes visible to you? I want to make sure I didn’t fork this into a private file…


Hi James,

happy to help, and yes, I can see your changes just fine :+1:

I have no knowledge of ruby on rails so apologies in advance if this is a stupid question, but I was wondering if it would make a difference in speed to make the ‘positive’ query, since there are more highway values to ignore than there are to keep.


I’ll have to figure out how to build that query. Maybe something that builds from:

['highway' == 'primary']

This is all Overpass API stuff - the only Rails-specific code is the #{area_id + 3600000000} piece that generates the correct Overpass Area ID from the OSM Relation ID that I store locally.
I included a pile of links in the Overpass Query sheet in your doc. :+1:

I would consider adding [‘service’ !~ ‘drive-through’] to the list. I have several Dunkin’ Donuts, Burger King, or other food drive-thrus showing up as streets in CityStrides.


I’m surprised that your local Dunkin’ drive-through actually got a name= tag…

But yes, I quite agree. Re-reading the OSM docs, I might even go one step further and do the cleaner thing which is to eliminate anything with “highway=service”


@zelonewolf Any advice on how we could block plazas from import?
They are defined by highway = pedestrian and area = yes, which appears correct per the pedestrian tag notes.
Seems like blocking either of those tags independently might be an issue.

1 Like

Is this an ongoing discussion? I support the idea to add

[‘highway’ !~ ‘bus_stop’]
[‘public_transport’ !~ ‘platform’]

The waiting areas at bus stops are supposed to be tagged as highway=bus_stop. So there is nothing we can do to correct OSM data here.

As far as I can tell, there is no need to include highway=bus_stop. Even if there is a road, the bus stop is never part of the road. There are always extra nodes for the stop. So we wouldn’t exclude any actual streets.



Yeah, I’m always looking to improve the OSM query.

Thanks! :tada:

1 Like

I had seen this locally, glad someone did the legwork to figure out why those were still coming in despite not being marked as streets

Well observed! At the bus station, a lot of “streets” will suddenly disappear from CS. :scream:

To be completely honest, I still have an open question for @JamesChevalier though, because I had listed a few bus stops for myself that are no real streets, and when I now check in OSM, I notice they are not marked as bus stops but as platforms, and although [‘highway’ !~ ‘platform’] is already in the query, they exist in CS as streets. Why?

One example among others: https://www.openstreetmap.org/way/392446581

At the bus station, a lot of “streets” will suddenly disappear from CS. :scream:

I don’t quite understand. Are there streets in OSM that aren’t present in CityStrides?

although [‘highway’ !~ ‘platform’] is already in the query, they exist in CS as streets. Why?

I continually improve that OSM query, so earlier cities brought in won’t be as “clean” as latter cities.

There are “streets” in CS that should not be streets and that will be eventually removed when you update CS.

At the bus station of my hometown, there are following streets in CS: Gate 07, Gate 08, Gate 15, Gate 16, Gate 17, Gate 18, Gate 19, Gate 20, Gate 25, Gate 26, Gate 27, Gate 28, Gate 29, Gate 30, Gate 31, Gate 32, Gate 33.
As you can guess, these are no real streets but platforms where the long distance buses stop.

Thanks for the quick answer.

@r.weide brought this up earlier. I am just supporting his idea, because I noticed a looot of bus stops in my city, that are “streets” or part of streets in CS. :wink:

@dbafounta: [‘highway’ !~ ‘bus_stop’] seems more general than [‘highway’ !~ ‘platform’] , as it includes the bus stops, that do not have a platform. The platform then is added with public_transport=platform, if there is one.