Friday, September 10, 2010

Geekout On A Sunny Day

I've been using GRASS for about two years now, mostly playing around with maps of Sals.  I have the trail network mapped out pretty well at this point, and recently figured out how to use GPX files of trail networks in my Garmin, having them them show up on the map like any other road, so naturally I wanted to do that with my Sals map on GRASS...

In the past I have been able to get the GRASS trails saved as GPX files, but the process involved jumping through a lot of hoops - I had to convert my data from the coordinate system I'm using on my personal map, to the standard one used by GPS units, then output that to a GPX file as output, converting from GRASS's internal format along the way. (There is actually a command in GRASS that would do all of this in a single step, but it never worked. Doh!)

Two nights ago I was messing with my map yet again, and wanted to generate a newer GPX file, and I got so totally frustrated by all the hoop-jumping and broken commands I couldn't think of anything else. Today's my Friday off, so as soon as I got up this morning I opened up the file for the offending command (a shell script called "v.out.gpsbabel"), took it apart and found the problem.

Turns out that the script massages the data by piping it through some sed commands, and this script, like so many scripts before it, had foundered on the rock of regular expressions. Two minutes figuring out what was supposed to happen, a schnipsel here and there, and now the thing works like a charm! I played with it for a while, but I only really had a half-minute task for it to do, and it was a bit anticlimactic after all that work.

I tapped the keyboard listlessly for a while, trying to recapture my fading high, then went out for a haircut. Now I'm hanging with Anne in a new (to me) coffee shop on New Street. (Anne wouldn't care, she's "blogging" old-school with pen and paper, but our regular coffee-shop hangout has had a lot of wireless problems lately, so we've been branching out.)

Another geeky discovery: I was clicking idly through phone's settings, and found that the Droid supports tethering, so I can access the Internet with the laptop, without needing a wi-fi connection. Sweet! -- but it's another anticlimax, because the wi-fi here at The Wise Bean is pretty decent. And so's the coffee...

Wednesday, September 08, 2010

Back To Work

Well, Labor Day is behind us, though due to the vagaries of our "every other Friday off" system this is actually a three-day week for me, it's not quite the end of vacation season... The weekend was spent with the usual biking hijinks (Big Pocono on Friday, Jacobsburg on Saturday, and a circumnavigation of South Mountain on the road bikes on Sunday), plus a few picnics and other end-of-summer activities.
 
Fun With Maps #1: For its monthly meetings, the VMB rotates through small list of venues, and the question always arises: which one is the most convenient -- in other words, which is closest, or easiest to get to -- for the majority of our membership? (We have members in  Raubsville and Bucks County, Emmaus and Macungie, Tamaqua, Stroudsburg, and the Slate Belt, and even a few in western New Jersey, as well as the Allentown, Bethlehem and Easton areas.) I don't have information on member addresses, but I do know where the different venues are, and I thought that, as a good first approximation, I could find the most centrally located of the venues by comparing driving times (as given by Google Maps driving directions) from each one to the others: the one with least total driving time to all the others would be the most centrally located.
 
I have about 10 venues in my dry run, which -- counting "point A to point B" and "point B to point A" as separate cases (drive times can differ in each direction), but ignoring "point A to point A" -- that gives 90 different sets of directions to work through. This looks like a job for automation, and luckily I found a way to do it. I wrote a pretty simplistic script the other day, to get the data from Google and look for drive times, but I don't have all the bugs worked out: there is no error checking, so if the mapping request hits a snag it just bombs. I should have the thing finalized in a few days though. From what preliminary results I did get, I suspect that the Bethlehem venues are going to remain the most viable meeting places.
 
Noted In Passing #1: Happy 110th Birthday, Galveston Hurricane!
 
Fun With Maps #2: Anne and I did a short Jacobsburg ride a week ago Thursday, hitting mostly the boring parts, doubletrack through grassy fields and the like, and were talking about the other parts of the park. Anne said that she and Donna had been exploring, but hadn't found their way over to the good parts, and she had found the official park trail map a bit inadequate...
 
That night I went onto Garmin Connect and grabbed a bunch of GPX tracks from Jacobsburg rides, mine and others, and then fired up TopoFusion. I fed in all the tracks, then ran TopoFusion's "make network" analysis -- this is the feature that made TF worth getting for me -- which analyzed them and reduced them to a single trail network. Plopped the new network into Google Earth, superimposed the official Jacobsburg trail (found online), and hit "Print," and we now have our own trail map!
 
So, this Friday we rode Jacobsburg again, with a little more time available to explore, though we forgot the new (printed) map -- Anne wanted to see what she could navigate from memory, so it was OK. I'd loaded a GPX of the trail network onto my Garmin, and I'd also uploaded a version of it onto Google Maps, and I wanted to experiment, compare and contrast, navigating with both Droid and Garmin...
 
The Garmin was a disappointment -- you couldn't see the trail network, just each separate trail in the network (like, one at a time), and it was more "navigate this trail" than "show the trail on the map." The Google Maps trail was beautiful -- much better looking than on the regular computer, where the network is spread among multiple pages instead of showing up all on one page -- and came in handy several times for illustrating where we were. We did everything in the park, except the grassy doubletrack...
 
Noted In Passing #2: Happy 36th Anniversary, Nixon Pardon!
 
Fun With Maps #3: In terms of the Garmin, it was back to the drawing board, which in this case meant back to Garmin to upgrade my firmware, and since they don't support Linux, that meant downloading their special software (with proprietary drivers) onto Anne's Mac, and going through the upgrade process from there. Things worked out just fine, despite the extra hoops I had to jump through; now I have the latest system on my 705, and that does support showing tracks on the map (you still have to work with them one at a time if there are a bunch on the GPX file). I experimented with this tonight -- I generated a GPX of the Sals trails from my GRASS database, and will added that as well as the Jacobsburg map. It's all I ever really wanted, that I didn't already have, from the 705, at least for now...
 
Passed, Not Noticed: It was just about 10 years ago that I had my worst bike crash ever. The actual date was August 11, 2000, when I crashed avoiding someone making a sudden left turn in front of me. Concussion, lacerations, coma, I spent the next 3 days in the hospital, and back in July I thought for sure that I would definitely remember the anniversary. Nope.
 
By blog doesn't go back that far, but here's what I wrote five years ago.