• Tag Archives bicycle
  • Out And About

    Posted on by Don

    It’s been a whirlwind of a Memorial Day Weekend…

    We went out Friday night, met Jennifer & Sean for some wings at The Keystone Pub, then we all went up the street to meet Yana and her boyfriend Evan at Big Woody’s. The food didn’t agree with me — don’t know what it might have been, I made poor food choices at both places — but we had a good time.

    On Saturday Anne and I got in a good ride: we went to Easton to help CAT with a booth at the big bike race celebration (in other news, Easton now has an annual “Twilight Criterium” on Memorial Day Weekend), but we got into town just before the rain started and we were trapped at the Easton Market for about two hours while it absolutely dumped outside. Oh well, coffee and bakery items, and people-watching, and then Mr. Lee’s Noodles for lunch… Scott and Jennifer C eventually joined us after the CAT booth closed up, and we all took advantage of clearing skies to bike back together. We got home just as the next downpour started.

    Later we went over to the Rose Garden for the Saturday Evening Concert. We saw Larry & Joyce, Mark & Sarah, and a whole bunch of other people including tons of little kids splashing in the puddles. We ended the night at our neighbor Josh’s fire-pit, along with with neighbors John, Matt, and Scott & Kellyn.

    Sunday was another ride for me, north on the towpath to explore the improvement work they’re doing. (Looks good, but I’m going to miss those wilder paths.)

    Now we’re getting ready to head over to Somerville to watch the big annual bike race with Joe & Laura and hopefully Ben.

    Enjoy a safe and happy Memorial Day! Remember those who gave their all.


  • Another Day’s Useless Energy Spent

    Posted on by Don

    I make online maps of Shawnee’s Road Scholar bike rides, to help the sag-wagon drivers find things like drop-off and pick-up locations, lunch spots, and other places where they’d meet up with the riders. (I did this after a driver searched for directions to the “D&L trailhead in White Haven,” but there were two trailheads in the town and he went to the wrong one. No biggie, the trailheads were less than a mile apart, but this kind of ambiguity looked like a problem that needed solving.) My first iteration was just a list of all locations in Google Maps’ “My Places,” but now I have a separate, full-blown map (again in Google Maps) for each ride, showing the route itself as well as marked points for the drop-off, pick-up, lunch, and all practical access locations, each with appropriate symbology.

    Here is an example for the Lehigh Towpath ride:

    (You can view the legend by clicking the button to the left of my name at the top of that map, or view the bigger map by clicking the square at top right.)

    I use Google Maps because that’s what the drivers use on their phones for navigation, and this makes it easy for them to navigate to any of my marked points without having to leave the Google Maps universe. To make the maps available, I generate QR codes for each map link; the driver can get the map and open it almost effortlessly with their phone’s barcode scanner. They don’t always use it — they weren’t as dazzled by my geeky brilliance as I was hoping — but hey I was impressed.

    The map data comes from a QGIS project I keep for all of the rides we do, or might do, as part of Shawnee’s Road Scholar bike program. My workflow is: select the route for the chosen ride and add it to a KML file, then select the relevant points of interest and append them as another layer in that file. (KML is “Keyhole Markup Language,” Google’s XML-based geographic data format.) I then import the KML file into Google Maps, and I’ve got my route and points on their own new map. A little bit of styling and I’m done — easy peasy! It takes about 5-10 minutes for each map. (The QR codes are generated separately using Jasper Reports.)

    And Here My Troubles Began

    I have these maps made for all the rides we’ve done, but I have a whole bunch of other rides, either unused or not fully developed, which don’t have their own maps yet, so there are more maps to do. Making each individual map is pretty easy, but I don’t always get the symbology (or the data associated with each feature) exactly the same each time, and I think that automating the task will help with consistency; also, if I start creating a lot more potential rides, the automated map-making could be a potential time saver.

    To automate my workflow, I decided to break it down into three basic tasks:

    1. extract the data I’d need from the database,
    2. use that data to generate a KML file, and
    3. import the KML file into Google Maps. (OK, this last step is still pretty manual…)

    This is the project I took with me to Colorado, working on it whenever we had an hour or two of downtime — something I can get away with when I vacation with a bunch of readers…

    The first step was pretty straightforward, though the SQL (especially for the points of interest) grew into a behemoth, with multiple CTE’s and a whole lot of joins to get things the way I wanted — setting it up just so took a bit of work, but like I said, the task was straightforward.

    The next task was more convoluted, and involved a learning curve — I decided to use Python to generate the KML, and this meant using several new packages: geopandas, which makes working with data a bit easier, and simplekml, which, well, does the KML part. Geopandas was pretty easy to use, but simplekml was quirky, maybe a bit too simple, and in the end I actually had to modify the source code to make it work right.

    But, in the end I got my KML file (technically, a KMZ file, which included the icons I’d need for styling), and I was able to import it to both Google Earth and Google Maps — the only problem was that Google Maps ignored all my styling! (It worked fine in Google Earth.)

    So, somewhere between steps 2 and 3 there was a glitch, a mismatch between what “styles ” meant for KML, and what Google Maps actually used. I spent a good part of the last few days looking at different versions of KML and KMZ files, seeing what worked, or didn’t work, with Google Maps, and I think I have an idea of what’s going on:

    Google Maps — or at least, the “My Maps” part of Google Maps — ignores most of the style information, like “use this icon and color,” and seems to code the style information, what they actually use, directly within the style ID’s: a style ID of “icon-1567-9C27B0-normal” would mean “use specific icon #1567, with color #9C27B0 for the normal (un-highlighted) icon.”

    So OK, first mystery solved, but what does that get me? I suppose I can use Google’s hard-coded style ID’s, but simplekml does not allow you to specify ID’s or change them, so it looks like that package isn’t as useful as it needs to be, and other Python KML packages seem… not simple.

    My next steps? My original plan was to code the entire task in SQL, and I may fall back on that, or I may do something using PHP. I might even take some text-based approach (like I did with geojson a few years ago), since KML is at bottom just a text file. But the truth is, I’m really just going to put this away for a while and let it marinate.


  • Can’t Beat The Heat

    Posted on by Don

    Two rides, two days: yesterday was a Freemansburg/Hellertown hill ride, and today Anne and I rode to Easton to brunch with Judy. Both rides were sunny, with 90-plus temperatures, and I am now wasted. Eighty nine miles for the (abbreviated) ride week though, so I feel pretty good.

    (Things could be worse: Denver just got a ton of snow — Emmi actually invoked the “more than 6 inches fell” rule and made sticky buns. At least it waited until we were gone this timeā€¦)

    Thunderstorms should be blowing in tonight, and tomorrow should be a bit cooler. Towpath?


  • New Bike!

    My writer’s block continues, but I thought I’d pop in to announce that I finally got my new bike, a Kona Sutra SE. This is a bike seriously designed for touring: fenders, a triple ring, (mechanical) disk brakes, bullet-proof tires, bar-end shifters, a Brooks saddle, and a rear rack, with frame attachments for a front rack as well — and oh yeah, steel is real, baby!

    bicycle
    My New Kona Sutra SE

    I picked it up Thursday night from Cutters Bike Shop, where it had just arrived; they knew I wanted one, and they called a week or so ago to say one was on the way, and then it was there at the shop, and so was I… I gave it a test ride with panniers, then rode it home — it doesn’t fit on the roof rack. Yesterday was its real maiden voyage, a bakery ride up to Nazareth.