X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1cc882b23f161ade83fb94052fa4a43c0caa16d2..0d187c5c711c5381872c21309fa74087b4896c49:/db/migrate/031_create_countries.rb?ds=inline diff --git a/db/migrate/031_create_countries.rb b/db/migrate/031_create_countries.rb index cc0627cd2..923d943f7 100644 --- a/db/migrate/031_create_countries.rb +++ b/db/migrate/031_create_countries.rb @@ -13,24 +13,6 @@ class CreateCountries < ActiveRecord::Migration end add_index :countries, [:code], :name => "countries_code_idx", :unique => true - - Net::HTTP.start('ws.geonames.org') do |http| - xml = REXML::Document.new(http.get("/countryInfo").body) - - xml.elements.each("geonames/country") do |ele| - code = ele.get_text("countryCode").to_s - minlon = ele.get_text("bBoxWest").to_s - minlat = ele.get_text("bBoxSouth").to_s - maxlon = ele.get_text("bBoxEast").to_s - maxlat = ele.get_text("bBoxNorth").to_s - - Country.create({ - :code => code, - :min_lat => minlat.to_f, :max_lat => maxlat.to_f, - :min_lon => minlon.to_f, :max_lon => maxlon.to_f - }, :without_protection => true) - end - end end def self.down