This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Evaluating type of road for a certain path given GPS coordonates

0

Hello,

Here is what i'm trying to achieve: I have a lot of GPS coordinates (long/lat) that represents an itinerary. I would like to be able to evaluate the types of road (highway tag of a way) for all these locations to be able to have statistics like this.

Your Itinerary : - 40% Secondary - 30% Track - 30% Residential

What i tried : I tried to use the Overpass Turbo to get the ways around my gps coordonates with this kind of script

    (
  way(around:1.0,45.645431, 1.812229);
  way(around:1.0,45.645381, 1.812486);
  way(around:1.0,45.645248, 1.812958);...); 
out tags;

I do get some results, like that :

 <way id="159143665">
    <tag k="highway" v="tertiary"/>
    <tag k="ref" v="D 132E1"/>
  </way>
  <way id="159143666">
    <tag k="highway" v="tertiary"/>
    <tag k="ref" v="D 132E2"/>
  </way>

But i don't retrieve a result for each gps coordinate so i cannot do statistics on that... I am not sure if my approach is good. Any advice/ solution?

Thanks for reading. Cheers.

asked 09 Mar '18, 09:44

Hydeo's gravatar image

Hydeo
11112
accept rate: 0%


One Answer:

2

What you want to do is called "track matching". It requires a routing engine. The routing engine will compute the most likely, valid path through the OSM street network that corresponds to your GPS track. Then, once you know exactly which roads have (likely) been traveled, you can compute your statistics. Many existing routing engines offer track matching (e.g. Graphhopper, OSRM), but I don't know off the top of my head whether their results will contain all the road type information you want, or whether you'll need to modify the software.

answered 09 Mar '18, 10:12

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Source code available on GitHub .