NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum


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 id="159143666">
    <tag k="highway" v="tertiary"/>
    <tag k="ref" v="D 132E2"/>

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

accept rate: 0%

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.

permanent link

answered 09 Mar '18, 10:12

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
accept rate: 23%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 09 Mar '18, 09:44

question was seen: 1,851 times

last updated: 09 Mar '18, 10:12

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum