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):

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