Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python, Let's Go Home. Quickly. (remote.python....

Python, Let's Go Home. Quickly. (remote.python.pizza 2020-04-25)

When your daily commute, shopping tour, or visit to family or friends offers many possible routes and real-time online navigation services are of no use for your individual mean of transport, you can still learn to find the optimal route.

Miroslav Šedivý

April 25, 2020
Tweet

More Decks by Miroslav Šedivý

Other Decks in Programming

Transcript

  1. <?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <gpx version="1.1" … > <metadata>

    <name>2020-04-25 remote.python.pizza</name> </metadata> <trk> <trkseg> <trkpt lat="49.013455" lon="8.4043583"> <ele>114.86</ele> <time>2020-04-25T09:23:33Z</time> <hdop>11.792</hdop> <extensions> <speed>4.61</speed> </extensions> </trkpt> <trkpt lat="49.0134691" lon="8.4041695"> <ele>113.86</ele> <time>2020-04-25T09:23:36Z</time> <hdop>11.792</hdop> <extensions> <speed>4.45</speed> </extensions> </trkpt> … </trkseg> </trk> </gpx>   eumiro 32
  2. gpsbabel -t -i gpx -f 2020-04-25-pizza.gpx -o unicsv,grid=utm -F 2020-04-25-pizza.csv

    No, UTM-Zone, UTM-Ch, UTM-East, UTM-North, Altitude, HDOP, Date, Time 1, 32, U, 456445, 5429122, 114.9, 11.79, 2020/04/25, 09:23:33 2, 32, U, 456431, 5429124, 113.9, 11.79, 2020/04/25, 09:23:36 3, 32, U, 456421, 5429124, 112.9, 11.79, 2020/04/25, 09:23:38 4, 32, U, 456407, 5429115, 114.9, 11.79, 2020/04/25, 09:23:40 5, 32, U, 456400, 5429111, 113.9, 12.86, 2020/04/25, 09:23:42 6, 32, U, 456382, 5429101, 113.9, 11.79, 2020/04/25, 09:23:45 7, 32, U, 456373, 5429091, 113.9, 11.79, 2020/04/25, 09:23:48 …   eumiro 33
  3. gpsbabel -t -i gpx -f 2020-04-25-pizza.gpx -o unicsv,grid=utm -F 2020-04-25-pizza.csv

    No, UTM-Zone, UTM-Ch, UTM-East, UTM-North, Altitude, HDOP, Date, Time 1, 32, U, 456445, 5429122, 114.9, 11.79, 2020/04/25, 09:23:33 2, 32, U, 456431, 5429124, 113.9, 11.79, 2020/04/25, 09:23:36 3, 32, U, 456421, 5429124, 112.9, 11.79, 2020/04/25, 09:23:38 4, 32, U, 456407, 5429115, 114.9, 11.79, 2020/04/25, 09:23:40 5, 32, U, 456400, 5429111, 113.9, 12.86, 2020/04/25, 09:23:42 6, 32, U, 456382, 5429101, 113.9, 11.79, 2020/04/25, 09:23:45 7, 32, U, 456373, 5429091, 113.9, 11.79, 2020/04/25, 09:23:48 … or gpxpy & utm, or GeoPandas   eumiro 33
  4. Python, Let's Go Home. Quickly. 1. gather the GPS tracks:

    OsmAnd 2. cleanup, split into rides: manual / pandas   eumiro 59
  5. Python, Let's Go Home. Quickly. 1. gather the GPS tracks:

    OsmAnd 2. cleanup, split into rides: manual / pandas 3. find nodes: pandas   eumiro 59
  6. Python, Let's Go Home. Quickly. 1. gather the GPS tracks:

    OsmAnd 2. cleanup, split into rides: manual / pandas 3. find nodes: pandas terminus nodes (home, work, shops, …)   eumiro 59
  7. Python, Let's Go Home. Quickly. 1. gather the GPS tracks:

    OsmAnd 2. cleanup, split into rides: manual / pandas 3. find nodes: pandas terminus nodes (home, work, shops, …) crossroads with turn restrictions and/or traffic lights   eumiro 59
  8. Python, Let's Go Home. Quickly. 1. gather the GPS tracks:

    OsmAnd 2. cleanup, split into rides: manual / pandas 3. find nodes: pandas terminus nodes (home, work, shops, …) crossroads with turn restrictions and/or traffic lights other crossings   eumiro 59
  9. Python, Let's Go Home. Quickly. 1. gather the GPS tracks:

    OsmAnd 2. cleanup, split into rides: manual / pandas 3. find nodes: pandas terminus nodes (home, work, shops, …) crossroads with turn restrictions and/or traffic lights other crossings 4. split tracks into segments between nodes: pandas   eumiro 59
  10. Python, Let's Go Home. Quickly. 1. gather the GPS tracks:

    OsmAnd 2. cleanup, split into rides: manual / pandas 3. find nodes: pandas terminus nodes (home, work, shops, …) crossroads with turn restrictions and/or traffic lights other crossings 4. split tracks into segments between nodes: pandas 5. build graph with nodes and elapsed times between them: networkx   eumiro 59
  11. Python, Let's Go Home. Quickly. 1. gather the GPS tracks:

    OsmAnd 2. cleanup, split into rides: manual / pandas 3. find nodes: pandas terminus nodes (home, work, shops, …) crossroads with turn restrictions and/or traffic lights other crossings 4. split tracks into segments between nodes: pandas 5. build graph with nodes and elapsed times between them: networkx 6. find path using statistics: networkx, statistics   eumiro 59
  12. Python, Let's Go Home. Quickly. 1. gather the GPS tracks:

    OsmAnd 2. cleanup, split into rides: manual / pandas 3. find nodes: pandas terminus nodes (home, work, shops, …) crossroads with turn restrictions and/or traffic lights other crossings 4. split tracks into segments between nodes: pandas 5. build graph with nodes and elapsed times between them: networkx 6. find path using statistics: networkx, statistics 7. output: matplotlib, ipyleaflet, OsmAnd plugin, whatever!   eumiro 59
  13. Python, Let's Go Home. Quickly. 1. gather the GPS tracks:

    OsmAnd 2. cleanup, split into rides: manual / pandas 3. find nodes: pandas terminus nodes (home, work, shops, …) crossroads with turn restrictions and/or traffic lights other crossings 4. split tracks into segments between nodes: pandas 5. build graph with nodes and elapsed times between them: networkx 6. find path using statistics: networkx, statistics 7. output: matplotlib, ipyleaflet, OsmAnd plugin, whatever! Miroslav Šedivý   eumiro 59