Sha256: 0ff771a2e4845fa6f93e7530cc079a3864d3234570f56c9feae168374a57ddc8

Contents?: true

Size: 946 Bytes

Versions: 9

Compression:

Stored size: 946 Bytes

Contents

require 'earth/locality/data_miner'
CountryRailClass.class_eval do
  data_miner do
    import "a list of country-specific rail classes and their pre-calculated characteristics",
           :url => 'https://docs.google.com/spreadsheet/pub?key=0AoQJbWqPrREqdFg3YVptS2FYdHBsb2kyZFRxSm5FdlE&output=csv' do
      key   'name', :synthesize => lambda { |record| [record['country_iso_3166_code'], record['rail_class_name']].join(' ') }
      store 'country_iso_3166_code'
      store 'rail_class_name'
      store 'passengers'
      store 'speed',                 :units_field_name => 'speed_units'
      store 'trip_distance',         :units_field_name => 'trip_distance_units'
      store 'electricity_intensity', :units_field_name => 'electricity_intensity_units'
      store 'diesel_intensity',      :units_field_name => 'diesel_intensity_units'
      store 'co2_emission_factor',   :units_field_name => 'co2_emission_factor_units'
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
earth-0.11.16 lib/earth/rail/country_rail_class/data_miner.rb
earth-0.11.15 lib/earth/rail/country_rail_class/data_miner.rb
earth-0.11.14 lib/earth/rail/country_rail_class/data_miner.rb
earth-0.11.13 lib/earth/rail/country_rail_class/data_miner.rb
earth-0.11.12 lib/earth/rail/country_rail_class/data_miner.rb
earth-0.11.11 lib/earth/rail/country_rail_class/data_miner.rb
earth-0.11.10 lib/earth/rail/country_rail_class/data_miner.rb
earth-0.11.9 lib/earth/rail/country_rail_class/data_miner.rb
earth-0.11.8 lib/earth/rail/country_rail_class/data_miner.rb