Tuesday 29 November 2011

TOIL and Trouble, the Elmden way

Last friday I had a TOIL day (Time Off In Lieu) so I decided a bike ride was in order. I am rubbish at hills so I thought I'd have a wander round the border country of Hertfordshire, Cambridgeshire and Essex, those notoriously mountainous regions.


View Larger Map

 For anyone doubting my credentials, here's the profile. Alpine, I think you'll find

and if you don't believe me that's the gradient. A whacking 7.5% or 8%. Impressed?


 

Tuesday 14 June 2011

Less Pain, more Route

I have a new love. OK maybe not exactly, but I've been having a lot of fun and quite a lot of success with bikehike which has a great combination of google maps and OS Maps.

If you get the settings right (in the options, google, follow roads, avoid highways, Coursepoint mode: auto etc) and you click in the right place, you can save a tcx file with advanced warning (which you set at save time) which you can upload to your Garmin Edge 500 and it'll warn you when to turn and which way to turn too.

If doesn't fit in perfectly with the previous flow, but, if you do have a gpx route you can TRY to create a tcx with warnings, this is how
:
  • Create a gpx file using the various previously discussed methods
  • Upload the gpx file
  • Select the correct options as above
  • Select Drag Edit mode
  • Hold down control and click on the route

This gives some black dots. If you drag the route a little between the black dots it should add coursepoints. Beware though that the route may go a bit wonky depending on how google thinks your routing should be.

Now save the file. Set your CoursePoint warning distance and average speed.

Note: you can also add static coursepoints by selecting "Add POI/Coursepoint" and selecting "general" and then making a note. Found this really quite useful for the Great Windmill Caper

Thursday 7 April 2011

Routes continue to be a pain.

At one point I wrote this which I stand by, up to the point at which you convert it.

Having been playing and reading Ridewithgps it suggests

"
  • GPX Track (.gpx) Useful for any GPS unit. Contains no cuesheet entries, only track information (breadcrum trail). Will provide turn by turn directions (true navigation) on the Edge 605 and 705, but will not have any custom cues. Edge 605/705 users follow these instructions.
  • Garmin Training Center (.tcx) Best format for turn by turn directions on Edge 500. Great for training when we release those features. Note: not currently optimal for Virtual Partner. Better support is being developed.
    "

    So I'll give this a punt

Monday 7 March 2011

Routes are a pain

I went out on Saturday with a preprogrammed course and GOT HORRIBLY LOST! In a good way, but not.

The problem, it seems, is that gmaptogpx draws too straight a line between points. This can be seen by

  1. Draw a route on Google Maps
  2. Create a GPX using GMapToGPX
  3. Upload the GPX to maptogps
It can be seen here that the route is "off"....


 To fix this

  1. Draw a route in Google Maps
  2. Create a GPX using gpsvisualizer (copying the URL of the google maps from the "link" window into the box
  3. Remember to select "Add DEM Elevation Data"
The equvalent map now looks like this: 

This is a much better fit.

Now use gpsies to convert to a .crs and import to the Garmin.

Monday 28 February 2011

Wiggle No Excuses sportive 2011

thisI'm going to attempt this on 20 March


View Larger Map


If and when I make it, I'll post the Garmin Connect data.

Wednesday 16 February 2011

Creating Bike routes: Now with added python

# Help yourself to this. If you find a bug or improve on it, please let me have a copy back!
# (c) Gareth Evans Feb 2011

# Format of data is
#<coordinates>x,y</coordinates>
#or
#<coordinates>
#x,y
#</coordinates>
#or
#<coordinates>x,y
#x,y</coordinates>
#etc


#Output format is
#From:<longitude>,<latitude><n*<space>to:<longitude>,<latitude>>
#Keep first and last lines, delete 1 in n lines, so total number of lines is 25

import sys, optparse

def write (where, what):
    #print what
    where.write (what)

def printStack (output, stack):
    count = 0
    modulus = 1 + len(stack) / 22
    print  "Stack size %d mod %d "%(len (stack), modulus)
    while len (stack):
        myline = stack.pop(0)
        if count == 0:
            myline = "from:" + myline + " "
            write (output, myline)
        else:
            if not (count % modulus):  
                myline = "to:" + myline + " "
                write (output, myline)
        count += 1

    myline = "to:" + myline + " "
    write (output, myline)



def main (options, args):
    image = open(options.image, "r").readlines()
    print "len %d name %s" % (len(image), options.image)
    namebody = options.image.split('.')
    name = "output_" + namebody[0] + ".txt"
    print name
    output = open (name, "w")

    coordinate = 0
    stack = []
    print "len image %d" % len(image)

   
    while len(image):
        myline = image.pop (0)
        pos = myline.find("<coordinates>")
        #print "coords %d pos %d len image %d data %s" % (coordinate, pos, len(image), myline)

        if coordinate == 0:
            if pos >= 0:
                coordinate = 1

        if coordinate == 1:
            if pos >= 0:
                data = myline[(pos + len("<coordinates>")):].split(',')
            else:
                data = myline.split(',')
            if (len(data) > 1):
                stack.append ("%s,%s" % (data[1], data[0]))
            if myline.find("</coordinates>") >= 0:
                coordinate = 0
       
    printStack (output, stack)

if __name__ == '__main__':
    option_parser = optparse.OptionParser()
    option_parser.add_option('-i', '--image', dest='image', help=' image', default='./file.txt')
    options, args = option_parser.parse_args(sys.argv[1:])

    main (options, args)

Making bike routes

This blog will be a set of possibly interesting routes around my locale (Cambridge) but the ability to create them, if you wish, will be passed on here.

I got a Garmin Edge 500 a year ago. Although I've not REALLY got into the courses, it's about time that I did.

When I started, I created my routes in Google Maps and then, through some convoluted magic I got them on my Garmin.

Then I found that there are a lot of routes already out there, in Google Earth format (*.kml) which often go where I want but don't always start where I want. So here's the deal.

There are some limitations in Google Maps format, notably that there appears to be a limit of 25 entries. Compared to a simple 30 mile KML file which may have 400 points. You WILL have to edit your routes.

So here's the plan. You'll need to be able to run python. It's not that tricky, and I haven't included any wacky modules. I'm using python 2.6. I'll add the file in the next post.

Downloading a KML file from MapMyRide
  1. Go you your purveyor of kml files. A good one is Map My Ride or
    gpsvisualizer
  2. Find some routes that look interesting and select Export
  3. Click on Download KML 
  4. Run the python script to generate a .txt file
  5. The data in the .txt file is then copied into google maps as shown below. A route will be generated which is now editable. Remember to set the route to walking (or bike) as some routes aren't generatable
  6. Use the convoluted magic to generate first a gpx then a crs
  7. To generate the route profiles I've used gpsvisualizer to generate profiles from the KML 

I've found a new resource. Not had a proper play yet but this seems to let you edit gpx files