In this repo I store the code I used for finding cycle paths and tracks
in 7 cities. The key to getting the data I needed is the R overpass
package which works with the
OpenStreetMap Overpass
API.
I have defined a bunch of functions for making the Overpass queries and computing distances or numbers of given nodes.
The whole process is described in a sort of make file.
Initial shapefiles for cities were prepared as shown here. For some cities it simply involved queries to GADM, for other I had to use shapefiles from official sources in the country. This data is not included in the repository.
I prepared a data frame with cities shapefiles and minimal and maximal latitude and longitude in this file. The queries to Overpass are done for a rectangle defined with minimal and maximal latitude and longitude and then I filtered results within the city boundaries.
I prepared the query strings in this code.
I made the queries and calculations for cycling infrastructure here. The results are in this file with a stupid name.
I made the queries and calculations for cycling infrastructure here. The results are in this file with a stupid name.
I also produced a few maps thanks to this code The maps are in the maps folder.