README.markdown in remote_table-2.1.0 vs README.markdown in remote_table-2.1.1
- old
+ new
@@ -1,8 +1,8 @@
# remote_table
-Open Google Docs spreadsheets, local or remote XLSX, XLS, ODS, CSV (comma separated), TSV (tab separated), other delimited, fixed-width files.
+Open Google Docs spreadsheets, local or remote XLSX, XLS, ODS, CSV (comma separated), TSV (tab separated), SHP (ESRI shapefiles), other delimited, fixed-width files.
Tested on MRI 1.8, MRI 1.9, and JRuby 1.6.7+. Thread-safe.
## Real-world usage
@@ -159,34 +159,34 @@
# A list of hybrid make model years derived from the EPA fuel economy guide
RemoteTable.new('https://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AoQJbWqPrREqdGtzekE4cGNoRGVmdmZMaTNvOWluSnc&output=csv')
# BTS aircraft type lookup table
RemoteTable.new("http://www.transtats.bts.gov/Download_Lookup.asp?Lookup=L_AIRCRAFT_TYPE",
- :errata => { RemoteTable.new('https://spreadsheets.google.com/spreadsheet/pub?key=0AoQJbWqPrREqdEZ2d3JQMzV5T1o1T3JmVlFyNUZxdEE&output=csv' })
+ :errata => { :url => RemoteTable.new('https://spreadsheets.google.com/spreadsheet/pub?key=0AoQJbWqPrREqdEZ2d3JQMzV5T1o1T3JmVlFyNUZxdEE&output=csv' })
# aircraft made by whitelisted manufacturers whose ICAO code starts with 'B' from the FAA
# for definition of `Aircraft::Guru` and `manufacturer_whitelist?` see https://github.com/brighterplanet/earth/blob/master/lib/earth/air/aircraft/data_miner.rb
RemoteTable.new("http://www.faa.gov/air_traffic/publications/atpubs/CNT/5-2-B.htm",
:encoding => 'windows-1252',
:row_xpath => '//table/tr[2]/td/table/tr',
:column_xpath => 'td',
- :errata => { RemoteTable.new('https://spreadsheets.google.com/spreadsheet/pub?key=0AoQJbWqPrREqdGVBRnhkRGhSaVptSDJ5bXJGbkpUSWc&output=csv', :responder => Aircraft::Guru.new },
+ :errata => { :url => 'https://spreadsheets.google.com/spreadsheet/pub?key=0AoQJbWqPrREqdGVBRnhkRGhSaVptSDJ5bXJGbkpUSWc&output=csv', :responder => Aircraft::Guru.new },
:select => proc { |record| manufacturer_whitelist? record['Manufacturer'] })
# OpenFlights.org airports database
RemoteTable.new('https://openflights.svn.sourceforge.net/svnroot/openflights/openflights/data/airports.dat',
:headers => %w{ id name city country_name iata_code icao_code latitude longitude altitude timezone daylight_savings },
:select => proc { |record| record['iata_code'].present? },
- :errata => { RemoteTable.new('https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdFc2UzhQYU5PWEQ0N21yWFZGNmc2a3c&gid=0&output=csv', :responder => Airport::Guru.new }) # see https://github.com/brighterplanet/earth/blob/master/lib/earth/air/aircraft/data_miner.rb
+ :errata => { :url => RemoteTable.new('https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdFc2UzhQYU5PWEQ0N21yWFZGNmc2a3c&gid=0&output=csv', :responder => Airport::Guru.new }) # see https://github.com/brighterplanet/earth/blob/master/lib/earth/air/aircraft/data_miner.rb
# T100 flight segment data for #{month.strftime('%B %Y')}
# for definition of `form_data` and `FlightSegment::Guru` see https://github.com/brighterplanet/earth/blob/master/lib/earth/air/flight_segment/data_miner.rb
RemoteTable.new('http://www.transtats.bts.gov/DownLoad_Table.asp',
:form_data => form_data,
:compression => :zip,
:glob => '/*.csv',
- :errata => { RemoteTable.new('https://spreadsheets.google.com/spreadsheet/pub?key=0AoQJbWqPrREqdGxpYU1qWFR3d0syTVMyQVVOaDd0V3c&output=csv', :responder => FlightSegment::Guru.new },
+ :errata => { :url => RemoteTable.new('https://spreadsheets.google.com/spreadsheet/pub?key=0AoQJbWqPrREqdGxpYU1qWFR3d0syTVMyQVVOaDd0V3c&output=csv', :responder => FlightSegment::Guru.new },
:select => proc { |record| record['DEPARTURES_PERFORMED'].to_i > 0 })
# 1995 Fuel Economy Guide
# for definition of `:fuel_economy_guide_b` and `AutomobileMakeModelYearVariant::ParserB` see https://github.com/brighterplanet/earth/blob/master/lib/earth/automobile/automobile_make_model_year_variant/data_miner.rb
RemoteTable.new("http://www.fueleconomy.gov/FEG/epadata/95mfgui.zip",
@@ -277,11 +277,11 @@
:skip => 22)
# heating degree day data from WRI CAIT
RemoteTable.new('https://docs.google.com/spreadsheet/pub?key=0AoQJbWqPrREqdDN4MkRTSWtWRjdfazhRdWllTkVSMkE&output=csv',
:select => Proc.new { |record| record['country'] != 'European Union (27)' },
- :errata => { RemoteTable.new('https://docs.google.com/spreadsheet/pub?key=0AoQJbWqPrREqdDNSMUtCV0h4cUF4UnBKZlNkczlNbFE&output=csv' })
+ :errata => { :url => RemoteTable.new('https://docs.google.com/spreadsheet/pub?key=0AoQJbWqPrREqdDNSMUtCV0h4cUF4UnBKZlNkczlNbFE&output=csv' })
# US average grid loss factor derived eGRID 2007 data
RemoteTable.new('http://www.epa.gov/cleanenergy/documents/egridzips/eGRID2010V1_1_STIE_USGC.xls',
:sheet => 'USGC',
:skip => 5)
@@ -439,12 +439,19 @@
[ 'spacer', 1 ],
[ 'header3', 10, { :type => :string } ],
[ 'spacer', 1 ],
[ 'header1', 10, { :type => :string } ]]
+ # ESRI Shapefile from NREL
+ require 'geo_ruby'
+ require 'dbf'
+ RemoteTable.new 'http://www.nrel.gov/gis/cfm/data/GIS_Data_Technology_Specific/United_States/Solar/High_Resolution/Lower_48_DNI_High_Resolution.zip',
+ :format => :shp
+
## Requirements
* Unix tools like curl, iconv, perl, cat, cut, tail, etc. accessible from your `$PATH`
+* geo\_ruby and dbf gems if you plan on fetching shapefiles
## Wishlist
* Win32 compat
* The new "custom parser" syntax (aka transformer) hasn't been defined yet... only the old-style syntax is available