class Object

Constants

FORM_DATA
MONTH_CODES
STATE_CODES

Derived from state code table in ftp.ncdc.noaa.gov/pub/data/cirs/divisional.README

URL

Public Class Methods

countries_dictionary() click to toggle source
# File lib/earth/air/airport/data_miner.rb, line 19
def self.countries_dictionary
  @countries_dictionary ||= ::FuzzyMatch.new Country.all, :read => :name
end
form_data_per_month() click to toggle source
# File lib/earth/air/flight_segment/data_miner.rb, line 187
def self.form_data_per_month
  Timeframe.new(Date.parse('2009-01-01'), Date.today).first_days_of_months.inject({}) do |memo, day|
    form_data = FORM_DATA.dup
    form_data.gsub! '__YEAR__', day.year.to_s
    form_data.gsub! '__MONTH_NUMBER__', day.month.to_s
    form_data.gsub! '__MONTH_NAME__', day.strftime('%B')
    memo[day] = form_data
    memo
  end
end
manufacturer_whitelist?(candidate) click to toggle source

We’re only interested in aircraft from certain manufacturers

# File lib/earth/air/aircraft/data_miner.rb, line 19
def self.manufacturer_whitelist?(candidate)
  @manufacturer_whitelist ||= RemoteTable.new(:url => 'https://spreadsheets.google.com/spreadsheet/pub?key=0AoQJbWqPrREqdFRFalpOdlg1cnF6amlSM1dDc1lya2c&output=csv').map { |record| record['Manufacturer'].to_regexp }
  @manufacturer_whitelist.any? { |manufacturer_regexp| manufacturer_regexp.match candidate }
end