Between the points A and Z in a city, there are several possible routes that may partially overlap or cross at crossroads (such as A→B→C→D→Z, A→J→C→D→Z, A→K→C→L→Z, A→M→N→L→Z, etc.). This may be represented by a directed graph.

I have a lot of GPX tracks (timestamp, lon, lat with GPS accuracy) from A to Z following any of these routes. Some of them follow the same path, but may have different durations at different sections (because of traffic, lights, weather, works, etc.).

I'd like to find the fastest (less time) route between A and Z. It is possible, that this route has never been traveled by any GPX track entirely, but consists of edges that have been traveled by different routes.

What tools would you use to dissect any number of GPX tracks into sections given a list of nodes? (open source and/or some Python modules preferred)

Let's assume these nodes are at least 300 meters from each other and the dissection should happen exactly in the middle between entering for the first time and leaving for the last time of the buffer of 50 meters around the given point. Or any other deterministic algorithm.

The result could be in the form {('A', 'B'): [50.1, 55.0, 61.1, …], ('A', 'J'): [81.1, 101.7], …}, with a list of durations in seconds between two nodes. Then I'd use Python's networkx to find the theoretically fastest route.

  • Dissolve polylines, single pars, ArcGis.
    – FelixIP
    Commented Jan 28, 2019 at 3:57


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.