Created
January 16, 2011 00:25
-
-
Save tokumine/781408 to your computer and use it in GitHub Desktop.
Vodaphone 3G tile scraper configured for UK coordinates
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
require 'rubygems' | |
require 'open-uri' | |
require 'fileutils' | |
require 'rio' | |
xmin = 102728.5 | |
xmax = 458539.5 | |
ymin = 20753.4117647059 | |
ymax = 219318 | |
xsize = xmax-xmin | |
ysize = ymax-ymin | |
x_tile = 2 | |
y_tile = 5 | |
y_tile.times do |y| | |
@ymn = ymin + (ysize * y+1) | |
@ymx = ymax + (ysize * y+1) | |
x_tile.times do |x| | |
@xmn = xmin + (xsize * x+1) | |
@xmx = xmax + (xsize * x+1) | |
puts "(#{@xmn},#{@ymn}) (#{@xmx},#{@ymx})" | |
url = "http://83.245.79.115/coverageviewer/web/Map.aspx?XMIN=#{@xmn}&YMIN=#{@ymn}&XMAX=#{@xmx}&YMAX=#{@ymx}&WIDTH=1300&HEIGHT=800&service=GB&mode=postcode&modeValue=1541818&searchEasting=435634&searchNorthing=219318&searchMapService=GB&searchType=postcode&activeLayer=ys3g_no2g&scale=6" | |
rio("#{url}") > rio("tmp/#{x}_#{y}.jpg") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment