Sha256: a16d1ba93f463bf328e87b2b55883fe2dadd2432495b46ab35bab1202672d084
Contents?: true
Size: 1.29 KB
Versions: 45
Compression:
Stored size: 1.29 KB
Contents
RailClass.class_eval do data_miner do schema Earth.database_options do string 'name' float 'distance' string 'distance_units' float 'passengers' float 'speed' string 'speed_units' float 'duration' string 'duration_units' float 'electricity_intensity' string 'electricity_intensity_units' float 'diesel_intensity' string 'diesel_intensity_units' string 'description' end process "Define some unit conversions" do Conversions.register :gallons_per_mile, :litres_per_kilometre, 2.35214583 end import "a list of rail classes and pre-calculated trip and fuel use characteristics", :url => 'http://static.brighterplanet.com/science/data/transport/rail/rail_classes.csv' do key 'name' store 'description' store 'distance', :from_units => :miles, :to_units => :kilometres store 'speed', :from_units => :miles, :to_units => :kilometres store 'duration' store 'passengers' store 'electricity_intensity', :field_name => 'electricity_per_vehicle_mile', :from_units => :miles, :to_units => :kilometres store 'diesel_intensity', :field_name => 'diesel_per_vehicle_mile', :from_units => :gallons_per_mile, :to_units => :litres_per_kilometre end end end
Version data entries
45 entries across 45 versions & 2 rubygems