How to extract gps coordinates of all bike paths from a certain area?

I am currently doing a project where we are trying to do road quality predictions, to better predict which roads needs repair when.

To achieve this we have had people on bikes gather data using a bike with a GPS and other measuring devices on them. From this we have gotten data from the same area, spread over about a year, of various people biking around in it:

Different colors represent data from different dates.

I would now like to match these gps coordinates up against the known bike paths in the area with the goal of cutting the bike path into different segments and aligning/interpolating the measurements to these different segments, such that I can use each segment as a data sample, and predict the current and future quality of that road segment.

My question is how can I extract the bike path gps coordinates or segments? I’m assuming that there is a somewhat standard procedure for this, but I am quite inexperienced in using open street maps.

Well, no, there isn’t a standard procedure for that. There are different mapping conventions for bicycling infrastructure in different countries and even different conventions in different parts of the same country :slight_smile:

One possibility would to use Overpass-Turbo to get data of bike paths.
Here an example,

/*
	get bike paths in the area shown in Overpass Turbo
*/
[out:json][timeout:25];
// gather results
(
  // highway=cycleway is a bike path for sure
  way["highway"="cycleway"]({{bbox}});
  // if a way is tagged bicycle=designated too
  way["bicycle"="designated"]({{bbox}});  
  // cycleway tagged as part of the road (lane) or separate (track)
  way["cycleway"~"^(lane|track)$"]({{bbox}});
  way["cycleway:right"~"^(lane|track)$"]({{bbox}});
  way["cycleway:left"~"^(lane|track)$"]({{bbox}});
  way["cycleway:both"~"^(lane|track)$"]({{bbox}});
);
// print results
out geom;

Look at the results via this link overpass turbo

You can export the result with the “Export” button, i.e. as GPX file.

image

You can use a search area instead of the bounding box, in my example the suburb Zollstock of Cologne:

/*
bike paths in the suburb Zollstock.
*/
[out:json][timeout:25];
// fetch area “Zollstock” to search in
{{geocodeArea:Zollstock}}->.searchArea;
// gather results
(
    way["bicycle"="designated"](area.searchArea);
    way["cycleway"~"^(lane|track)$"](area.searchArea);
    way["cycleway:right"~"^(lane|track)$"](area.searchArea);
    way["cycleway:left"~"^(lane|track)$"](area.searchArea);
    way["cycleway:both"~"^(lane|track)$"](area.searchArea);
    way["highway"="cycleway"](area.searchArea);
);
// print results
out geom;

And I’m sure I missed one tagging possibilty or two :smiley:

1 Like

Thank you that was really helpful!

Typically you would use “map matching” Map matching - Wikipedia to match the recorded tracks to our geodata, for example with OSRM open-source-spec/osrm/doc/osrm_mapmatching.md at master · Telenav/open-source-spec · GitHub

It might actually make sense to run this against a reduced network of only cycle(able) infrastructure to reduce errors. I would defer to somebody with actual practical experience doing that for an opinion.

2 Likes