Skip to content

Instantly share code, notes, and snippets.

@tokumine
Created January 16, 2011 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tokumine/781408 to your computer and use it in GitHub Desktop.
Save tokumine/781408 to your computer and use it in GitHub Desktop.
Vodaphone 3G tile scraper configured for UK coordinates
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