Earthtools
Get Version
0.0.1→ ‘earthtools’
What
The Earthtools Gem provides a library for consuming the web services provided by Earthtools. More information on the Developer API may be found here. This API may be used obtain geographical information such as timezones, sunrise and sunset times as well as height/elevation for a set of latitude and longitude coordinates.
There are a couple of limitations to consider (refer to the Earthtools website for any changes):
- You must not make more than one request per second to these webservices
- You must cache results if you believe that you will need to make another identical request within any 24-hour period
- You must delete any cached data when you no longer need it and in any case after 14 days. You should then make a new request for the data in line with the previous two rules. If you wish to keep access to data I am able to license the data for use in this way
Installing
sudo gem install earthtools
The basics
Each method will return a hash of the resulting values, which are described here.
Demonstration of usage
require 'rubygems' require 'earthtools' #Obtain the timezone details using a latitude and longitude coordinate #More info here: #http://www.earthtools.org/webservices.htm#timezone tz_data = Earthtools.timezone({ "latitude" => "36.454062", "longitude" => "-122.224081" }) #Obtain the sunrise and sunset details using a latitude and longitude coordinate #More info here: #http://www.earthtools.org/webservices.htm#sun tz_data = Earthtools.sunrise_sunset({ "latitude" => "37.793915", "longitude" => "-122.402909", "day" => "4", "month" => "12", "timezone" => "-8", "dst" => "0" }) #Obtain the height details using a latitude and longitude coordinate #More info here: #http://www.earthtools.org/webservices.htm#height tz_data = Earthtools.height({ "latitude" => "36.454062", "longitude" => "-122.224081" })
Forum
http://groups.google.com/group/earthtools-api-gem
How to submit patches
Read the 8 steps for fixing other people’s code and for section 8b: Submit patch to Google Groups, use the Google Group above.
The trunk repository is git clone git://rubyforge.org/earthtools.git for anonymous access.
License
This code is free to use under the terms of the MIT license.
Contact
Comments are welcome. Send an email to Jason [at] goecke.net email via the forum
Theme extended from Paul Battley