My kid got a new project: find fire stations. Google Maps is not really helpful here, obviously. And searching in the OpenStreetMap web interface is also a lot of work. But Overpass Turbo is able to find all the places.
When you open the Overpass Turbo page, it starts in Rome, Italy, at the Colloseum. That’s nice, but likely not the place you are looking for. Either scroll to the area you are interested in, or use the search function.
The left side of Overpass Turbo is the input field. You draft queries in a specific language, named Overpass QL (QL). Once you hit the Run
button, the right side of the window either shows you the map, or the data output.
The QL has a couple options, but let’s start with the basics. I moved the map to Berlin, Germany, near the Brandenburg Gate and Alexanderplatz. Then I started with this simple query:
|
|
The result is visible using this link. One can see 5 different results, in 4 different areas of the city. Near Friedrichshain apparently there are two circles close together, something to investigate and see what is wrong there. The {{bbox}}
limits the results to the currently visible map box.
But let’s verify the results further. Scrolling the map to Berlin Frohnau, where I know a fire station. When I run the query again, the map is empty. That’s … unexpected. The fire station is clearly on the map. But it’s not a Node, it’s a way. Which means I should not only search for nodes, but also for ways and relations. Let’s expand the query:
|
|
In OpenStreetMap, only Nodes have coordinates. Ways and Relations are made up of polylines and areas (groups or collections of nodes respective points). The extended syntax in the above example shows the output on the map. The result includes the known fire station - success.
But it does not look nice. Fire stations are red, not Overpass blue. The result can be formatted. For this, a {{style}}
can be added:
|
|
Ways, Nodes and Relations are formatted red, and filled red. Also the english name is picked (which should be available in many cases). The new query:
|
|
All fire stations - no matter which type - are red now. Looks much more recognizable now.
Last but not least a bit of maintenance, one can specify a timeout which tells Overpass Turbo to abort the query if it runs too long. It’s useful to always include this parameter, and avoid overloading the server if the result set is becoming too big.
|
|
The entire query now:
|
|
And the result for Berlin. That’s quite a number of fire stations there, and good input for the project!
And next time I try to extract the data in a way which can be imported into other programs. Only the nodes have address data and coordinates, would be nice if Overpass Turbo can somehow export that for all results.