Posts

Showing posts from January, 2012

simple Strava to CSV ride decoder with Perl

Slight detour from my project... Just wanted confidence I could decode JSON data, at least in Perl. I wrote a little decode for Strava ride data using Perl. The code, which I call "Strava_to_csv", requires a command line option specified as follows: Strava_to_csv -activity activity-number where activity-number is the number of the activity. It's nothing fancy, and not very robust. It expects all data to be scalar except for "latlng", which is an array of two numbers, the first the latitude, the second the longitude. It worked for me. This code uses the JSON module version 2.53 from CPAN. There's a lot of stuff there about encoding type, but since Strava is unicode, it worked simply. The code is written for Linux and maybe OS/X: it uses a system call to the "wget" command to download the URL (a Perl package for HTML could be used instead). Anyway, here's my code. This hardly took any effort at all, maybe 30 minutes, which makes m...

writing my Strava Android app, part 2

More progress... First, I did more sketch work on my proposed pages for the app. One of these involves data plots: plotting the altitude, and on a separate plot, speed from a Strava activity on a graph. This is the biggest challenge of my GUI design: the rest consists of a text widget, a bunch of button widgets, and some labels, with more simple widgets in the "configuration" screen. Plots with limited pixels are a challenge: I believe the screen resolution is only 480 × 800 for which only a small subset, for example 400 × 100, will be available for each plot. Not so bad, actually, but real estates needs to be used efficiently. I'll avoid doing anything fancy: no scrolling or zooming, for example. The goal is just to identify portions of the ride in a clearly identifiable fashion. For this I can either do my own plots with graphic primitives or use a more general purpose plotting package. I'm not yet decided on this. Second, I looked into the Strava API itse...

writing my Strava app: part 1

The first step in writing my Strava app was to make a note of exactly what I wanted it to do. Well, perhaps not exactly: I don't know the capabilities yet of the Strava API. In particular, does the Strava API allow you to replace the data on a ride? Apparently it does, since StravaHaHa allows modification of ride data. Honestly I don't know where the API is documented, but I am deferring that until later. No rush. So then when I knew what I wanted the program to do, I set out to design some pages. So I measured the screen on my HTC Incredible phone and found it was 5 cm wide by 8 cm high. So I set up an image file using GIMP with 500 pixels wide by 800 pixels high, and for each screen, began "sketching out" how I wanted the page to look. It's different assembling a page from a widget tool kit, so details aren't critical here: I just the look and feel of each page. When I got tired of doing that, and I was on-line, I started downloading some of the s...

writing an Android app

I've long wanted to write an Android app so now seems a fairly good time to give that a shot. I want to port over some Perl stuff I've done, not directly necessarily, probably in Java, which I've done some work in before but long ago. I really liked Java, though: a proper object oriented environment rather than the layered kludge-fest which is C++, or for that matter "object-oriented Perl", neither of which I've ever liked. I end up with hybrid object oriented - sequential code. Better to have the environment optimized for the object oriented paradigm and stick with that. Step one didn't go too well... upgrade my Ubuntu to the 11.10, but then my CD drive on my old Thinkpad isn't working well. I tried to clean it but now it's working worse... Anyway, I got a book on the subject ( Android Applications for Dummies ), but am not waiting for that to arrive. There's plenty of on-line reference material and tutorials. Book form is just more ...

rating New Zealand climbs

Image
I've described a decent number of climb profiles from my trip to New Zealand, with profile data collected from a Garmin Edge 500 or, in the case of Haylocks, by Strava using topological data in conjunction with positions recorded by the Strava Android app. It's then obvious to ask: how do the climbs compare? Which was the toughest? Good question. First, some data. I plot here the altitude gained versus the climbing distance for each of the climbs. I define "the climb" as the portion of road which maximizes my climb rating, which I've described in this blog before. Here's the result, where I normalize each by the number associated with Old La Honda road: What makes a climb tough? To me, it's continuous time spent at a big grade, with a lot of altitude gained. click on image for expanded view profile of Haylocks from Maori church. Ignore wiggles, a mapping artifact; climb is continuously up. Click on image for larger view. Using an objectiv...

climbing Onuku hills

Image
With climbs, there's a tendency to focus on those which gain big altitude and are frequently ridden, preferably in top-level races. However, sometimes it's the back-road little-known compact climbs are equally memorable, or in this case, surprisingly challenging. The day after my big Banks Peninsula hill ride, I went for a short scenic ride with Cara south of Akaroa. The goal was to check out Lighthouse Road. From the distance Lighthouse road is clearly visible, etched in the side of the treeless hill, the occasional car snaking its way slowly up the road's numerous switchbacks. It looked steep. But before our trip I'd set Cara's bike up with a 34/32 SRAM 1070 cassette with a medium cage SRAM Rival rear derailleur, a very nice combination which seemed to work very well (I detected no reduction in shift quality relative to her previous SRAM Red short-cage). So I figured we'd go check it out and see how steep it really was. Looks can be deceiving. In cent...

Climbing Dyers Pass Road

Image
Christchurch was the beginning and end of my just-completed trip to New Zealand. Christchurch consists of a dense central district, a suburban ring, and beyond that, agricultural land dramatic mountains. The central district has been largely destroyed in two days of quakes: 4 Sept 2010, and a highly destructive aftershock on 22 Feb 2011. The damage to the suburbs is less visible but just as real: many houses were condemned due to structural damage. But the riding outside the city limits remains truly excellent. There's three popular passes just south of the city: Gabbies Pass, Dyers Pass, and Evans Pass. My route book, " Classic New Zealand Road Rides " by Jonathan Kennett and Kieran Turner described a ride over Gabbies Pass and Evans Pass, and shorter ride over Dyer Pass and Evans Pass. Each of these rides went over Evans Pass, but I was told as I staged at Zero's Cafe near Princess Margaret Hospital in Cashmere (part of Christchurch) that Evans was closed. S...

Climbing Pigeons Bay and Okains Bay Roads

Image
After climbing Long Bay Road on that second ride, I continued along Skyline Road, west towards Hill Top. Summit Road was absolutely gorgeous. Never flat, it's alternately up and down the whole way as it offers fantastic views of both sides of the ridge. It's reminiscent of Skyline Road in San Mateo and Santa Clara counties of California, Summit Road and Highland Road down near Loma Prieta, and Ridgecrest Boulevard on Mount Tamalpais, or El Camino Ciel above Santa Barbara. Each is gorgeous, each similar yet unique. The pavement on Summit on Banks Peninsula was quality chip-seal, no issues at all, and traffic was light, although a high fraction of the traffic was trucks. It's a rural place, with ranches on either side of the road, ranches taking up much of New Zealand land. So I passed first the road to Le Bons, then Okains Bay Road, then Pigeon Road, in addition to several "unsealed" roads along the way. But then I emerged finally at Hill Top, the terminus...

Climbing Long Bay Road

Image
Akaroa on the Banks Peninsula, southeast of Christchurch on South Island, New Zealand, provides for excellent cycling: probably the best encountered on Cara on our vacation. First up on the list is Long Bay Road, which goes from the northern boundary of Akaroa up to Summit Road. Summit runs along the rim of a volcano, Akaroa Harbour forming the cone, and Long Bay (among others) on the outer edge of the rim. There's a series of roads which run from the harbor (the cone) over the rim. From east to west the paved ones are Long Bay Road, Okains Bay Road, and Pigeon Bay Road. I rode all three while in Akaroa last week, but Long Bay received most of my attention. Long Bay is the longest and toughest. Upon arriving in Akaroa, having done a fantastic 10 km trail run at Lake Takape that morning, I went for a "preview" ride of the hill. I'd not planned on doing the whole climb, but with Summit Road dangling in the distance, the hills mostly stripped of sight-blocking tr...

climbing Crown Range pt 2 : Queenstown side

Image
Having climbed the east side of the pass, it was time to descent to the west. Every new turn brought a fresh view of the scene laid out before me, and it was a challenge to keep my focus on the road. After a wonderful series of sweeping turns, one punctuated by an active road construction crew, I entered the final portion of this descent, a series of tight hairpins reminiscent of my descent of the Poggio on the Ligurian Coast last fall. I knew I was riding these too slowly, but taking the turns a bit easier had the benefit of extending their duration, and they were worth savoring. The descent done, I was ejected onto Highway 6. I expected this would take me to Arrowtown just down the road: a few km at most, based on my reading of the route profile before I'd left. But I'd misunderstood the route profile. What had been so close to the Crown Range was Arrowtown Junction, not Arrowtown. It was still 5 km to the town. So down the side road I went. When I arrived at the to...

climbing Crown Range pt 1 : Wanaka side

Image
During a particularly good SF2G, I head the rider called "Space" say he'd been to New Zealand. I asked him what the best ride he'd done there. "Wanaka to Queenstown", he said. At that moment this became a "must-do" for my trip to the country. There's two routes connecting the two cities. The main route, Highway 6, goes around the mountain while the more direct route, Crown Range, goes over it. Obviously Space has been referring to the latter. Crown Range was only paved relatively recently. Indeed, the profile in Scott Kennedy's book marks it as dirt. The text description, on the other hand, makes no mention of a dirt surface (although gravel on shoulders is described in the summary directions). Obviously Lonely Planet had failed to update the profile in the edition where the text was updated with the new road work. The book has many issues. Strava verified Space had ridden the Crown Range. So when Cara and I arrived in Wanaka,...

Hass Pass returned from the dead

Weird... After not seeing the Haas Pass data on several log-ins, it appeared on my account... not sure where it was hiding, but glad to see it back! Actually, I think there's an issue with Synchronization when running in "airplane mode" when running the Strava app on a phone. I'm running airplane mode because data and voice are too expensive overseas, and I want to avoid any risks apps will check for updates or new mail or whatever and incur $1.99/minute data charges. And when I'm on vacation, spending time dealing with the internet becomes a low priority: it's liberating to do things like read actual newspapers, play Scrabble, or just sit and enjoy the chirping of the birds in the morning. So Haas is back. A few other activities are now mysteriously missing, but I have confidence eventually my phone will "sync" them with my account. Patience, patience.... On my trip: not riding much, but every day is something: runs, hikes, even a fun day ...

climbing Haas Pass

Image
Next on my list of New Zealand climbs was Haas Pass. In a way, this was a ride destined to end in tears. But more on that at the end. Cycling New Zealand, a guide written by Scott Kennedy for Lonely Planet, describes the route from Makorora to Haast Junction, crossing the pass. However, if you look carefully at profile, shown on page 268 of the Sept 2009 edition, it's clear that only three data points were used for the profile between Haas Pass and Haas junction, covering 82 km. There's a point at the junction, of course, then one at 11 km from the pass at 100 meter elevation, then one at the pass itself, at what appears to be 560 meter elevation. So that's 460 meters gained in 11 km, an average of 4.2%. No problem, one might decide: this calls for an 11-20 straight block. Heh. I rode with Cara from our D.O.C. (pronounced "doc") campsite at Boundary Creek. Riding was effortless, it seemed, a good sign that there was going to be a heavy price to be paid l...

Climbing Arthur's Pass

Image
New Years Day meant two big events for me: riding the San Bruno Hill Climb for the first time in four years, and going to SFO to fly to New Zealand. After a night in Christchurch, viewing the sobering post-apocalypse which was the central business district and the contrasting beauty of the botanical gardins, Cara and I got in our rented camper van and headed out on national highway 73. Our destination: Jackston's Retreat, a very nice holiday park in Jacksons, west of Arthur's Pass through the New Zealand Alps. I'd read about Arthur's Pass using Strava Explorer . It's part of the Five Passes Tour , a combination bike tour + state race where riders tour the southern island and are timed over 5 climbs along the way. Arthur's Pass is rated a 5: the maximum points of the five. The profile was impressive. The net stats are fairly close to Kings Mountain Road: 6.87 km and 490 meters of total climbing, no intermediate descents: average grade = 7.16%. Kings mo...

San Bruno Hillclimb

Image
San Bruno this year was a striking contrast to the Low-Key Hillclimbs in which I participated for six consecutive Saturdays from October to November: the nature of the climb and the wind made for an especially tactical race. San Bruno Hillclimb route profile I'd registered for E3 instead of my master's 1-2-3 category because, considering the start list at that time, I thought my podium chances were better in E3. To that point, E3 registrations were typically light, but the masters was already heavily populated with big guns. In the "clearly stronger than me" department were Cale Reeder and Kieran Sherlock. Carl Nielson was there: I'd beaten him in our last head-to-head, on Kings Mountain, but that had been the only time in my recollection and the big money was on him to finish ahead. Add in Clark Foy and Tim Clark, both of whom had been training well, who were also in contention for the podium, not to mention the riders with whom I was unfamiliar, and an ...