Wednesday, March 9, 2016

Auto Routing

While the freehand drawing tool helps, it's never been easy to plan long-distance trail hikes using CalTopo.  The only two ways to get realistic mileage estimates were to painstakingly trace over the map, or import someone else's GPS tracks.

By piggybacking on the MapBuilder database, CalTopo now has an auto-routing feature.  There are still a few quirks to work out, and at least until that happens, I'm leaving the feature off by default.

Start by creating a line, the same way as always:



Once you're in drawing mode, there's a new "snap to" option at the top right of the screen, next to the layer control:



As the names suggest, None turns the feature off, OSM uses OpenStreetMap data, and USFS uses Forest Service data.  With auto-routing enabled, roads and trails show on the map as semi-transparent black lines:


To begin routing, click one of the segments (it will turn red when you mouse over):



Once you are snapped to a segment, mousing over additional segments will automatically create a routable line.



Mouse back out and you'll see the traditional straight drawing tool:


Unlike typical routing tools that require you to specify start, end and mid points, this makes it easy to jump between trails and cross-country travel within the same route.  Some of the known quirks at this point include:

  • Roads and trails need to have a common vertex for the auto-router to recognize that they intersect, so some of the solutions it comes up with will not be optimal travel routes.  Think of it as "auto drawing" rather than "auto routefinding".
  • Some OSM trailheads have small gaps between the road and the trail; the auto-router will not properly jump between these.
  • For performance reasons, only 2000 lines are pulled back at once.  At wide zoom levels, the road/trail network shown will probably be incomplete.
  • Computations can lock up the browser for several seconds, especially when scrolling to a new coverage area.   Clicking on the map during these lock-ups causes the auto-router to loose track of the line you were snapped to.

Accurate trail mileages are an issue that comes up constantly, and there's no easy answer.  However, I thought the JMT would be a good test case.  In the summer of 2014, I had to plot a JMT route by modifying some PCT GPS tracks available online.  This time I was able to trace it out in a couple minutes using the auto-routing tool; the slowest part was making sure I stayed on the JMT proper rather than a nearby variation.

routing mid-trail

The CalTopo-drawn line was 210 miles to Whitney Portal, vs the official number of 221.  So about 5% short, which doesn't seen too bad.