Class: Geonames::Weather

Inherits:
GeonamesResource show all
Defined in:
lib/map_layers/geonames.rb

Overview

GeoNames Weather REST services

Class Method Summary collapse

Class Method Details

.weather(options) ⇒ Object

Weather stations with the most recent weather observation

Example: Geonames::Weather.weather(:north => 44.1, :south => -9.9, :east => -22.4, :west => 55.2)

www.geonames.org/export/JSON-webservices.html#weatherJSON



53
54
55
# File 'lib/map_layers/geonames.rb', line 53

def self.weather(options)
  self.find(:all, :from => "/weatherJSON", :params => options)
end

.weatherIcao(icao, options = {}) ⇒ Object

Weather station and the most recent weather observation for the ICAO code

www.geonames.org/export/JSON-webservices.html#weatherIcaoJSON



61
62
63
# File 'lib/map_layers/geonames.rb', line 61

def self.weatherIcao(icao, options = {})
  self.find(:all, :from => "/weatherIcaoJSON", :params => { :ICAO => icao }.merge(options))
end