Tuesday, 11 November 2008

BirdMap - now with added Emerald Isle

Since the BirdMap was introduced, every time I've looked at it I've winced inwardly at the column of squares snaking downwards from the northeast corner. These mainly represent sightings from Northern Ireland and the Republic of Ireland, which until now we've been unable to plot on the map. The fundamental reason is that the BirdMap is based on the Ordnance Survey's National Grid, which makes everything relatively straightforward - it's easy enough to convert an OS grid reference such as SK123456 into x and y co-ordinates (from the OS's grid origin, somewhere southwest of the Scillies), scale it to the map, and plot.

The Irish Grid (as used in Northern Ireland and the Republic) is a different kettle of fish - the "origin" is different and to make matters worse the grid is at an angle to the British grid (any mapmakers out there please excuse my cartographic illiteracy - I'm aware of the differences between 2D and 3D mapping projections, though I don't pretend to understand them). Another problem we had is the paucity of online mapping for Ireland - the UK has the excellent http://www.streetmap.co.uk/ site, and from there and many other sources it's relatively easy to establish an approximate grid reference for most birding sites; not so across the Irish Sea. The online mapping sites that do cover Ireland (notably http://www.multimap.com/ and http://maps.google.com/) tend to deal in latitude and longitude, which our mapping functions weren't equipped to deal with.

So for a long time I wimped out of the challenges of widening the BirdMap to include the island of Ireland.

The big breakthrough came when I discovered some useful public-domain functions on the OS website (actually written as macros on a downloadable Excel spreadsheet, but easily translated to the VBScript that we use). These allow conversion to and from the 2D systems of the Irish and OS grids to latitudes and longitudes in 3D. Some of the maths is pretty horrendous; for example:

III = ((nu / 24) * (Sin(RadPHI)) * ((Cos(RadPHI)) ^ 3)) * (5 - ((Tan(RadPHI)) ^ 2) + (9 * eta2))

but fortunately I didn't have to understand it all, I just needed to know some key constants that define the two grids, which my friends at www.geograph.org.uk kindly supplied.

This solved two problems in one go: (1) it gave me a means of translating the Irish x, y co-ordinates, via latitude and longitude, onto the same grid as the OS, and (2) it allows us to input grid references as latitude and longitude figures and convert to either grid. A few handy but fiddly functions later the groundwork was done.

It then took a while to source a suitable base map (thanks to our designer David Suttle, who spent a tedious afternoon emulating Slartibartfast as he traced the complicated outline of the British Isles for us) but it's all in place now. Another spin-off is that I've been able to increase the size of the map, which reduces, but doesn't entirely solve, the problems of congestion in bird-rich areas. Watch this space (and I might eventually be able to do something about the Channel Islands too). Oh, and I improved the "cacheing" as well, so older maps should load more quickly than before as they don't have to be recompiled every time.

Beyond the BirdMap, our new Irish-aware system has other benefits. Before now, our systems had no way of knowing that Kilbaha and Loop Head (to choose a pertinent example) are only a few miles apart. So our automatic systems that link new reports with previous reports of the same bird (which are designed to cope with inconsistent selection of adjacent "sites" by our contributors and operators but rely on our knowing the approximate location of the sites) didn't work in Ireland. They do now.

A further spin-off is the ability to provide links to Google Maps and Multimap for Irish sites, as well as lists of nearby sites and nearby birds, on our site pages. All this won't be 100% effective until we've completed the not-insignificant job of establishing references for over 800 remaining Irish sites, but we've done nearly 250 of the most productive sites already. We may be asking for your assistance at some point, though there's still some work to do on our publicly available site input pages so for now it's an in-house job.

The new BirdMap is at http://www.birdguides.com/birdmap but access to today's map is limited to Bird News Extra subscribers and readers of our weekly email newsletter. As a free taster, though, anyone can look at the map for this date last year:



No comments: