• Quick And Dirty For The Win

    Posted on by Don

    Well, that KML problem didn’t get to marinate for long: I decided to just have a python script write the output as a generic text file. It’s a pretty dumb program, but it worked like a charm. I tested it by making maps of all my remaining unofficial rides, maybe half a dozen in all. The process took less than a minute per map, thus saving me about an hour of work, at the cost of only a month of coding… Hey but it was an interesting learning experience!

    It was also interesting to see the difference between the maps of official rides and the less-developed, unofficial ones — the new ones seem so sparse, with missing lunch spots and fewer access locations. It’s clear, from seeing them on these maps, that at least some of the new rides aren’t ready for prime time.

    Anyway, yesterday was a bike rest day for me, and I got a bunch of yardwork and other chores done. Today and tomorrow look like rain.


  • Time To Face The Music

    Posted on by Don

    I’m slowly getting back in the swing of cello things: I played duets with Donna on Tuesday, and yesterday was my first lesson in probably a month. I thought I played well, for both the lesson and the duets — I’d been practicing since we got home, so I didn’t expect to stay rusty — but I was pretty tired after each one.

    Meanwhile: We haven’t done quartets in a while, and my ensemble is on hiatus for the summer, and the music studio I go to is about to close (the owners are retiring).

    That is 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?


  • Vacation Reading

    Posted on by Don

    Congratulations to my niece Olivia, who graduates high school today!

    Some books…

    I brought both The Dazzle of Day and Deacon King Kong along on this trip, and finished them both. Both had long ago become chores to get through (especially Dazzle), and both turned out OK by the time they ended (especially DeaconDazzle of Day was just unrelentingly depressing almost to the very end).

    Being on vacation meant that we had to visit a few bookstores, and that meant more new books:

    Thin Air, by Richard K. Morgan: I burned through this one in a few days, and finished it on the flight home. This was another in my long series of “bubblegum for the mind” sci-fi books, and it was classic Richard K. Morgan: a genetically modified super-warrior, washed up and gone vaguely rogue on Mars, gets himself involved in some serious interplanetary spy-soldier drama. Lots of hyper-violence, high tech, and cheesy sex… I already can’t remember the hero’s name, but it was a fun read while it lasted.

    Piranesi, by Susannah Clarke: I’d been planning to read this for a while, but put it off to read her first book (Jonathan Strange and Mr. Norrell, which took me forever to finish) then other things intervened… But I picked it up in Colorado Springs, and am now about a quarter of the way through. I’m not sure what it’s really about yet, but so far it’s the journal of an earnest, somewhat naive (amnesiac?) young man named Piranesi, who lives in the ruins of a giant house, which seems to be the only thing in his universe. It feels like something sinister is coming down the pike, but so far the vibe is a lot like The Slow Regard of Silent Things, and the world-building — the part I like best anyway — is really good.


  • Lay Your Head On Summer’s Freckled Knee

    Posted on by Don

    Morning weigh-in: 171.5#, 11.5% BF (not great, not terrible)

    Today was the first weigh-in since we got back from vacation, and it’s also the first “fast day” since before Denver — who diets on vacation? But now I’m back, and back in the groove.

    I got in a towpath ride yesterday, my first bike ride in weeks. It was a beautiful warm sunny day, and Spring (which had just been starting to happen when we left), was in full bloom along the towpath. All sorts of flowers (phlox, king’s rocket) along the path, with fully greened-up trees all around, blooming with flowers of their own and filling the air with perfume, just perfect as I rode along the sun-dappled trail with the water sparkling next to me.

    Anne went out earlier on a road ride with Julie, and reported that she could feel a positive effect from our weeks at altitude. I noticed it too: my perceived effort and my heart rate were both lower than I expected, and I seemed to be cruising along at a good clip too. Then I reached my turnaround, and realized I’d had a tailwind on the way out… Still, I felt pretty good considering my time away from the bike, and had a good overall pace despite the wind.

    Today was the CAT/Bethlehem Bike To Work Day festivities and short ride, and in a few minutes I’m bicycling over to a doctor’s appointment. Bike bike bike…


  • Denver, And Departure

    Posted on by Don

    Well, we’re home. We flew to Philly yesterday and rented a car to get the rest of the way — hard to believe, but that’s probably the easiest way to get between PHL and here. We were home in time to vote, but there’s no food here, the grass was ( was! ) a foot tall when we drove up, and the car had trouble after sitting for two weeks — it sounds like something is broken and clanking inside one of the wheels, no idea how that could have happened just sitting there. But now the car’s been towed to the shop, the lawn has been tamed, my first load of laundry is done and I’m gearing up for a bike ride, my first ride in two weeks…

    Our time back in Denver after Colorado Springs was not too crazy, we just stayed in a nice hotel downtown and did some exploring: we saw the Denver Art Museum, and visited the REI “flagship store,” and watched the lunar eclipse from the fancy rooftop bar we could see from our hotel window. We’d returned the rental, so we did everything on foot, except for one time, when we rented those electric scooters we saw everywhere. (Sorry, no photos!) We did see Emmi & Kyle for dinner a few more times, and also managed to get together for an afternoon with my nephew Chris.

    For completeness, here the are photos from the final phase of our trip:

    And that was our trip!


  • Florissant Fossil Beds

    Posted on by Don

    Our trip today was up into the mountains, out near Cripple Creek to the Florissant Fossil Beds National Monument. This was a place where, 34 million years ago, a lake/creek area was buried by volcanic activity — all these giant redwoods were buried to about 15 feet or so, and what was buried got fossilized while what was above rotted away. (All sorts of other plants, as well as fish, insects, and small mammals, were fossilized as well.) Fast forward to about 50 years ago, and this area was saved from development and the national monument was born…

    This was a really fun and spectacularly beautiful way to spend the day, and afterward we stopped for a late lunch on the way home.

    This is our last night in Colorado Springs; tomorrow we head back up to Denver for the final leg of our trip.


  • Downtown Colorado Springs

    Posted on by Don

    It was a bit warm yesterday so we decided to do some indoor exploration: we went downtown to the arts/historic district (Old Colorado City), got some lunch, and then visited the Colorado Springs Fine Arts Center at Colorado College. They had several exhibits going on, including one reexamining John James Audobon and his prints, and one room filled with Chihuly works.

    We finished our day with a visit to a coffee-shop/bookstore, where we all ended up getting several books.


  • Garden of the Gods

    Posted on by Don

    Greetings from Colorado Springs!

    We got here Sunday, and did a little bit of walking around Monday, but things got real yesterday when we got up early and explored The Garden of the Gods. This is a spectacular park (and National Natural Landmark) on the edge of town, which features the same kind of up-tilted sandstone formations we saw near Red Rock. There really isn’t much of a narrative here, we just walked around, admiring the views and and taking pictures:

    Right about that last photo is where I somehow managed to change my camera settings to a sort of “focus” effect, which made these last few a bit odd but hey, these are the photos I got:

    And finally, one last shot of Pike’s Peak, from our table at the pub where we had lunch:

    Pike’s Peak From Our Lunch Table