Tracing Railway Lines

An article in Computer Shopper in about 2007 described how to draw a vector graphic line in a browser and so I put together some javascript to track and record mouse clicks. The clicks would be over a set of map tiles, showing a 1940s 1″ Ordnance Survey map (and therefore both open and closed railway lines), working out the distance travelled along the line and therefore the current milepost mileage. A suitable set of map tiles for England, Wales and Scotland was readily available on-line as part of a project to capture grid references to match postcodes. As this would be a tool to gather information it would not need to be multi-browser capable: the vector graphics example code used a Microsoft library and the tracing has proved to work only in Internet Explorer 6/7 under Windows XP.


The tracing starts at the point marked '1', with a second click at '2' and the mouse being moved to the next point on the line ('3') with a red line showing the route to be traced between '2' and '3'. Blue dots show the route behind (the quarter (•) and half (••) mileposts can be seen). It requires Javascript to display correctly.

The mouse click positions are written into a browser window and the result captured (once tracing of the route is complete) by using 'view source' and 'save page'. The format of the text file is an Anquet 'export' format (.aef) which simply lists the grid references of waypoints along a route. This can be read directly into the Anquet mapping software and displayed and edited over a background of a modern 1:25000 or 1:50000 Ordnance Survey map. This page on my website (http://www.svrsig.org/Trace.htm) shows how this works. As the route is traced it is written into a separate window:

and the result is a file that looks like this:

Anquet Maps,AEF,v2
RouteStart,"1",""
Waypoint,"0.00",151452,32940,0,"","005",""
Waypoint,"0.00",151452,32940,1,"MP","006","MP 001-010"
Waypoint,"0.10",151258,32995,1,"","007","MP 001-011"
Waypoint,"0.20",151065,33050,1,"","008","MP 001-012"
. . .
RouteEnd     

It is a series of grid references of the mouse clicks, with 'milepost' markers dropped every ten chains so that you can see the route you have just traced. Using Windows XP and Internet Explorer 6/7, the view shows a red line extending from the last click to the current mouse position indicating the line you are about to 'draw'. So far I have traced the whole of the Great Western, Midland, LNER (south of Doncaster), Southern, Scottish and Irish railways.

The overlay GIFs show the lines already traced.