Automatically inferring / refining hiking trails in OpenStreetMap from multiple GPX tracks – existing solutions?

I am new to GIS, but I’m working on a project that collects dozens to hundreds of hiking GPX tracks (mostly recorded with smartphones or wearables).

My goal is to use these tracks to

  1. snap / refine existing OSM trail geometries where the recorded paths consistently deviate from what is currently mapped; and
  2. detect totally unmapped trails and create OSM-ready geometries (with at least highway=path + basic tags).
  3. achieve full automation—human intervention must be minimised because we intend to gather data from large numbers of consumers.

This task is challenging because the GPX tracks contain only x, y, z, t data, whereas OSM requires node, way and relation structures.

I have already googled academic papers and found Amazon’s RING-Net paper, which rasterises trajectories and applies deep-learning segmentation. Unfortunately, the code is not public, and reproducing it quickly seems unrealistic. Before I start reinventing the wheel, I’d like to know what the GIS community already uses for this kind of task.

Data characteristics & constraints

  • Tracks are foot-traffic only (≈ 3 km h⁻¹ average, elevation changes).
  • Sampling interval varies (1–5 s typical).
  • GPS noise up to ±15 m is common under trees.
  • I can accept a Python-centric or C+±centric stack; licence must be OSI-approved.
  • Output should be either a set of new OSM ways with nodes in correct order or corrected way which is obtained by moving existing nodes to the consensus position.

So, my questions are:

  1. Are there established open-source libraries or scripts that already implement a full (or near-full) pipeline for multi-track trail inference + OSM update?
  2. If not, which algorithms / workflow components have proven reliable in practice for off-road trails?
  3. How do you usually validate that an automatically generated path is really a trail and not just a set of parallel zig-zagging points (common in forests)?
1 Like

Hi, welcome to OSM!

Are you aware of Automated Edits code of conduct - OpenStreetMap Wiki?

Also possibly related threads:

There is also this (theoretic, but still) current discussion:

They don’t quite capture your questions, but I think they are interesting reads.

I guess “near-full” means that you would be working on the missing parts.
They probably don’t exist, because it’s 1. very tedious to create and 2. would need extensive discussion with likely no result.

Visiting the place and mapping it according to survey.

See answer 2.

Apart from that, GPX trails only give you the trajectory of the path, but no other information (like surface, trail_visibility, sac_scale, …). Those can only be added via survey.

But fret not! All of this only applies to the last step (Updating OSM) which is likely to stay manual for a long time. However, I imagine it useful to have those trails anyway (on a different site) and be able to mark certain corridors as checked (either saying “there is no path”, saying “path route updated”, or mapping it). In that sense, it would become similar to Strava, but better.

Thanks for your interest in OSM, and engaging with the community in this way. It’s really helpful! Perhaps others can help you with the technical details.

2 Likes

Not exactly what you asked for, but:

1 Like

can you share them under some open license that we can use? Or maybe some aggregated version like Strava?

so we can use these for mapping even if fully automated version (these are horribly hard to get working) would not be achieved?

1 Like

Actually, I wish to contribute so if I get permission from the company I working in, However I am not in the position to decide…

That is not a lot. Unless you meant, of the same trail.

From my point of view, that is the OSM way to do it: Visit the location. I’d expand: map to survey and anything else available, eg. Strava, LIDAR, aerial come to mind.

Oh, I meant on the same trail. Actually my company is planning to collect random GPX trails from several thousands of customers, and it is expected to able to collect dozens to hundreds of pieces of trails per single courses.

With the customer’s knowledge & approval?

Then what licence will your company be publishing / releasing the data under?

Yes, we are planning to get permission to use the positional data before collecting them. Distribution plan is yet to be decided.

I’d still say, providing one more tool for mappers (like the Strava heatmap) preferred over mechanical edits.

3 Likes

Yes, a heatmap would be great. A couple of optional improvements over Strava:

Normalize the heat, some heavily used trails are “blown out” on the Strava heatmap

Have a winter only mode if any if the trails are winter only.

2 Likes

Although the proprietary source, it seems to me that I found the solution:
It “almost” satisfies my need; I have to convert input & output to appropriate format.
http://mapconstruction.org/