This tool returns the Watsonian vice-county (or vice-counties) that the grid reference contains (see http://en.wikipedia.org/wiki/Vice-county for more information on vice-counties). It is accurate to 100m (although by the nature of the data down to 1m accuracy is available where the 100m grid square contains a single vice-county) and works with tetrad (e.g. SE45Y) and 5km grid references (e.g. SE45NW) as well as 1km, 10km and 100km grid references.
There are currently no plans to include the Praeger vice-counties of Ireland – I’m not aware of any similar boundaries being available to create the necessary data. Correct me if I’m wrong and I may look into it.
This tool as a web service:
To call the service (currently without charge or restriction; if you’re planning on hammering the service, please let me know in advance – whilst I don’t charge, Google does!), use a URL of the following format:
where <gridref> is a grid reference or list of grid references seperate by a comma and <format> is one of JSON, XML, TEXT or left blank for “pretty” HTML output with the actual vice-county names (as used above).
The web service makes no attempt to notify or correct invalid grid references – it simply returns nothing if no match is found.
VC7 North Wiltshire<br />VC8 South Wiltshire
The information is based on data provided by the NBN. Contains Ordnance Survey data © Crown copyright and database right 2012.
If you interested in the mechanics behind the web service, it’s basically just a large (very – over 3.5 million data points) lookup table containing grid references and their vice-counties hosted by the Google App Engine with the script behind the scenes written in Python. A little optimization is done in that those grid references whose “parent” grid reference contains 100% of one vice-county can be assumed to be the same vice-county, and memcache is used to store recent queries, but that’s about as complicated as it gets.