com.snowplowanalytics.weather.providers.openweather
amount of history requests storing in cache it's better to store whole OWM packet (5000/50000/150000) plus some space for errors (~1%)
nth part of 1 to which latitude and longitude will be rounded stored in cache. For eg. coordinate 45.678 will be rounded to values 46.0, 45.5, 45.7, 45.78 by geoPrecision 1,2,10,100 respectively geoPrecision 1 will give ~60km infelicity if worst case; 2 ~30km etc
instance of OwmAsyncClient
which will do all underlying work
timeout in seconds after which active request will be considered failed
amount of history requests storing in cache it's better to store whole OWM packet (5000/50000/150000) plus some space for errors (~1%)
amount of history requests storing in cache it's better to store whole OWM packet (5000/50000/150000) plus some space for errors (~1%)
Get current weather data by city coordinates Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_weather#2-By-geographic-coordinate
Get current weather data by city coordinates Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_weather#2-By-geographic-coordinate
latitude
longitude
either error or current weather wrapped in Response
Get current weather data by city id Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_weather#3-By-city-ID
Get current weather data by city id Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_weather#3-By-city-ID
id of the city
either error or current weather wrapped in Response
Get 5 day/3 hour forecast data by city name Docs: http://openweathermap.org/forecast#5days
Get 5 day/3 hour forecast data by city name Docs: http://openweathermap.org/forecast#5days
name of the city
optional two-letter code
count of returned data
either error or forecast wrapped in Response
Round position and timestamp (event) to produce cache key
Round position and timestamp (event) to produce cache key
timestamp in seconds
latitude & longitude
cache key
Transform JSON into parseable format and try to extract specified response
Transform JSON into parseable format and try to extract specified response
specific response case class from
com.snowplowanalytics.weather.providers.openweather.Responses
either of previous or JSON
either error string or response case class
Get forecast data for coordinates
Get forecast data for coordinates
latitude
longitude
either error or forecast wrapped in Response
Get forecast data by city id Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_forecast#Get-forecast-by-city-id
Get forecast data by city id Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_forecast#Get-forecast-by-city-id
id of the city
either error or forecast wrapped in Response
Get 5 day/3 hour forecast data by city name Docs: http://openweathermap.org/forecast#5days
Get 5 day/3 hour forecast data by city name Docs: http://openweathermap.org/forecast#5days
name of the city
optional two-letter code
count of returned data
either error or forecast wrapped in Response
nth part of 1 to which latitude and longitude will be rounded stored in cache.
nth part of 1 to which latitude and longitude will be rounded stored in cache. For eg. coordinate 45.678 will be rounded to values 46.0, 45.5, 45.7, 45.78 by geoPrecision 1,2,10,100 respectively geoPrecision 1 will give ~60km infelicity if worst case; 2 ~30km etc
Overloaded getCachedOrRequest
method with Joda DateTime instead of Unix epoch timestamp
Search history in cache and if not found request and await it from server and put to the cache.
Search history in cache and if not found request and await it from server and put to the cache. If timeout error was taken from cache, do request again
event's latitude
event's longitude
event's timestamp
weather stamp immediately taken from cache or requested from server
Get timestamp for beginning of the day
Get timestamp for beginning of the day
event's timestamp
timestamp for beginning of day of this event
Get historical data by city name Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_history#By-city-name
Get historical data by city name Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_history#By-city-name
lattitude
longitude
start (unix time, UTC)
end (unix time, UTC)
count of returned data
one of predefined Api.Measures
to constrain accuracy
either error or history wrapped in Response
Get historical data by city id Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_history#By-city-id
Get historical data by city id Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_history#By-city-id
id of the city
start (unix time, UTC)
end (unix time, UTC)
count of returned data
one of predefined Api.Measures
to constrain accuracy
either error or history wrapped in Response
Get historical data by city name Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_history#By-city-name
Get historical data by city name Docs: http://bugs.openweathermap.org/projects/api/wiki/Api_2_5_history#By-city-name
name of the city
optional two-letter code
start (unix time, UTC)
end (unix time, UTC)
count of returned data
one of predefined Api.Measures
to constrain accuracy
either error or history wrapped in Response
Main client logic for Request => Response function,
where Response is wrappeed in tparam Response
Main client logic for Request => Response function,
where Response is wrappeed in tparam Response
type of weather response to extract
extracted either error or weather
Round coordinate by geoPrecision
Scale value to tenths to prevent values to be long like 1.333334
Round coordinate by geoPrecision
Scale value to tenths to prevent values to be long like 1.333334
latitude or longitude
rounded coordinate
timeout in seconds after which active request will be considered failed
Blocking OpenWeatherMap client with history (only) cache Uses AsyncOwmClient under the hood, have same method set, which return Weather instead of Future[Weather]
WARNING. This client uses pro.openweathermap.org for data access, It will not work with free OWM licenses.