Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>View our Election Results - Lichfield District Council</title>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/standard.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/style.php" media="screen" />
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special_print.css" media="print" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Election results for Alrewas and Fradley | Lichfield District Council</title>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/standard.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/style.php" media="screen" />
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special_print.css" media="print" />
<!-- This is an example of the key content on a typical page containing ward results pages, marked up appropriately to -->
<!-- expose the information as data rather than just text -->
<!-- NB The eklection data below is dummy data and has been altered to better demonstrate the markup -->
<!-- ####### -->
<!-- ####### -->
<!-- ####### -->
<!-- We start by attached basic info to the div that wraps around the data. -->
<!-- First we need to declare the XML schemas we're going to use and the shortcuts by which we'll refer to them -->
<!-- This is an example of the key content on a typical page containing links to ward results pages, marked up appropriately to -->
<!-- expose the information as data rather than just text -->
<!-- ####### -->
<!-- ####### -->
<!-- ####### -->
<!-- We are using the <div> which wraps the content to declare the 'namespaces' for various attributes we use to give the links meaning -->
<!-- e.g. we say that when we're talking about foaf things (e.g. foaf:isPrimaryTopicOf) we mean things defined at "http://xmlns.com/foaf/0.1/" -->
<div id="mainContent" xmlns:openelection="http://openelectiondata.org/0.1/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<!-- This is an example of the key content on a typical page containing links to election results pages, marked up appropriately to -->
<!-- expose the informationas data rather than just text -->
<!-- ####### -->
<!-- ####### -->
<!-- ####### -->
<!-- We are using the <div> which wraps the content to declare the 'namespaces' for various attributes we use to give the links meaning -->
<!-- e.g. we say that when we're talking about foaf things (e.g. foaf:isPrimaryTopicOf) we mean things defined at "http://xmlns.com/foaf/0.1/" -->
<div id="content" xmlns:openelection="http://openelectiondata.org/0.1/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Council location | Lichfield District Council</title>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/standard.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/style.php" media="screen" />
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special_print.css" media="print" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Council location | Lichfield District Council</title>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/standard.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/style.php" media="screen" />
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special_print.css" media="print" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Council location | Lichfield District Council</title>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/standard.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/style.php" media="screen" />
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special_print.css" media="print" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Council location | Lichfield District Council</title>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/standard.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/style.php" media="screen" />
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.lichfielddc.gov.uk/site/styles/generic/ie_special_print.css" media="print" />
# Based on http://gist.github.com/258730 and on http://www.nearby.org.uk/tests/GeoTools.html. Not yet working properly
module OsCoordsUtilities
E2 = 0.0066705397616 # OSI eccentricity squared
A = 6377563.396 # OSI semi-major
B = 6356256.910 # OSI semi-minor
extend self
def convert_os_to_wgs84(eastings, northings, height=0)