Tuesday, February 26, 2013

Route Almost Anywhere

I have been working on setting up all of the routes in the Quetico so the RouteFinder will work in that area. To help with this, I created some tools that I use to automatically create routes between certain points on a lake. (These tools are making the work go much faster than creating all of the BWCA routes, which I had to do somewhat manually.)

The past couple of days I was thinking that the "auto-routing" tool could also be modified to actually work in the RouteFinder to enable routes to any point on a lake instead of just entry points, campsites, and portages. It didn't take too much work to make this possible.

This new feature isn't perfect, but it appears to be performing fairly well. In order to express the limitations of the feature, it would help to understand a little of how the RouteFinder works. This explanation will be a little lengthy, so you can just go ahead and start using the new feature. However, if you ever want to understand why some things work and some don't, come back here and read more.

To set up the RouteFinder, I had to create a network of routes throughout the BWCA. The network consists of a bunch of (what I call) route points and routes connecting the points together. This can be compared to roads where the routes are the roads and the route points are intersections.

These routes and route points are not shown on the interactive map. Rather, they just exist in the background and are used in the RouteFinder calculation. Here is an example of what I see in my "route-creating" tool:

This is the map of the routes on Kekakabic Lake. The green dots are the route points (intersections), and the green lines are the routes (roads) connecting the points. Another thing you can notice is the blue lake outline in the picture. The lake outlines exist on the interactive map but are invisible. (This is how you can click on a lake and get more information on it - the outline is there, you just can't see it.) For purposes of this discussion, you just have to realize that the lake outlines are not perfect. They don't exactly follow the shoreline. Some islands are not outlined (meaning they are treated as if they were water). I haven't worked on these issues since "fixing" a lake is a lot of work and the outlines don't affect many things in the program.

When I created all of the BWCA routes, I put all of the green lines in manually - meaning I had to click and create every single one of the 25,000+ routes. This took many hours of work over several months. When I started on the Quetico, I thought that there had to be an easier, faster way. I created a small program where I could specify a few route points and the computer would connect all of the points to each other. The program goes through every route point on a lake and tries to connect it to every other. If the route would potentially pass through an island or the shore (it intersect any of the lake boundaries), the route would not be created.

There are advantages and disadvantages to this. The advantages are obvious. Many routes are created just by putting a few points on the map. It is much, much faster than doing what I did before, and it has helped me to get a lot of the Quetico routes done quickly (I'm about 50% done now). There are a couple of disadvantages, however. First, many more routes are created than are necessary. This means that when you try to map a route, the computer has to analyze many more routes and it takes longer to come up with an answer. Second, as mentioned above, the lake outlines are not perfect. After I "auto-create" the routes, I have to look at them and delete any that mistakenly pass through an island or the shore. The advantages far outweigh the disadvantages.

This is the program that I realized could be adapted to dynamically create routes in the RouteFinder. I modified it so you can specify any point on a lake to route to. The program then connects your "new point" to all of the surrounding route points, as long as the "new" routes don't pass through any land. This is where some of the routes may become a bit "quirky" at times. As stated above, the lake outlines aren't perfect, so sometimes you may notice that your route passes through an island or the shore. Sometimes there aren't any route points nearby to connect to. I didn't envision this feature when I first created all of the routes and route points, so the route may seem to zig-zag at times when trying to connect to the nearby points (especially on lakes with few campsites). Finally, since it is trying to create routes on the fly, any RouteFinder calculation with a custom point in it will take significantly longer to calculate.

You can connect two custom points as long as they are on the same lake. If the route between the two points would cross any boundaries, the two points cannot be connected directly. The program, though, will attempt to connect the two points by connecting to other route points that may be connected to each other.

If you specify a point that is not on a lake, it will just find the nearest route point within an approximately one-mile radius and try to route there. Because you can't see where the nearest route points are, this may seem to give odd results at times. I put this feature in, though, so you can find out how far it is, for example, halfway up a river. (Rivers have a lot of route points to choose from since I had to put one at every bend and turn.)

Despite the limitations of the new "route-anywhere" feature, I think it will be very helpful. I foresee it will be used most in finding fishing routes (for example, how far is it along that shoreline?). It can also be used to modify the standard, built-in routes (i.e. what if I wanted to go on the north side of the island instead of the south side?).

As always, I am open to suggestions and comments. Feel free to contact me.

No comments:

Post a Comment