This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OnsDatasetFinder | |
require 'httpclient' | |
BaseUrl = "http://neighbourhood.statistics.gov.uk/dissemination/" | |
def self.process | |
all_datasets = [] | |
home_page = "http://neighbourhood.statistics.gov.uk/dissemination/Download1.do" | |
parsed_page = get_page(home_page) | |
dataset_group_paths = parsed_page.search('#mainContent3 li a[@href*="datasetList.do"]').collect {|ds| ds[:href]}.uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OnsReader | |
require 'httpclient' | |
BaseUrl = "http://neighbourhood.statistics.gov.uk/dissemination/" | |
def self.process | |
sets = YAML.load_file(File.join(RAILS_ROOT, "db/ons_data", "current_datasets.yml"))[0..100] | |
client = HTTPClient.new | |
sets.each do |set| | |
url = set[:url] |
NewerOlder