find_nearby_stations {weatherOz} | R Documentation |
Find the Nearest Weather Stations to a Given Geographic Point or Known Station
Description
Find nearby weather stations given geographic coordinates or a station code for both of the DPIRD and SILO weather station networks. Either a combination of latitude and longitude or station_code must be provided. A DPIRD API key is only necessary to search for stations in the DPIRD network. If you are not interested in DPIRD stations in Western Australia, you may use this function to query only SILO stations for all of Australia without using a key.
Usage
find_nearby_stations(
longitude = NULL,
latitude = NULL,
station_code = NULL,
distance_km = 100,
api_key = NULL,
which_api = "silo",
include_closed = FALSE
)
Arguments
longitude |
A |
latitude |
A |
station_code |
A |
distance_km |
A |
api_key |
A |
which_api |
A |
include_closed |
A |
Value
A data.table::data.table()
with station_code
, station_name
,
latitude
, longitude
, elev_m
, state
, owner
, and distance
.
Data are sorted by increasing distance from station or location of
interest.
Note
You can request your own API key from DPIRD for free by filling out the form found at https://www.agric.wa.gov.au/web-apis.
Author(s)
Rodrigo Pires, rodrigo.pires@dpird.wa.gov.au, and Adam H. Sparks, adamhsparks@gmail.com
See Also
Other DPIRD:
dpird_extreme_weather_values
,
dpird_minute_values
,
dpird_summary_values
,
find_stations_in()
,
get_dpird_apsim()
,
get_dpird_availability()
,
get_dpird_extremes()
,
get_dpird_minute()
,
get_dpird_summaries()
,
get_stations_metadata()
Other SILO:
find_stations_in()
,
get_data_drill()
,
get_data_drill_apsim()
,
get_patched_point()
,
get_patched_point_apsim()
,
get_stations_metadata()
,
silo_daily_values
Other metadata:
find_forecast_towns()
,
find_stations_in()
,
get_available_imagery()
,
get_available_radar()
,
get_dpird_availability()
,
get_stations_metadata()
Examples
## Not run:
# Note that queries to the DPIRD API require you to have your own API key.
# Query WA only stations and return DPIRD's stations nearest to the
# Northam, WA station, "NO", returning stations with 50 km of this station
wa_stn <- find_nearby_stations(
station_code = "NO",
distance_km = 50,
api_key = "your_api_key",
which_api = "dpird"
)
# Query stations nearest DPIRD's Northam, WA station, "NO" and return both
# DPIRD and SILO/BOM stations within 50 km of this station.
wa_stn <- find_nearby_stations(
station_code = "NO",
distance_km = 50,
api_key = "your_api_key",
which_api = "all"
)
# Query Wagga Wagga BOM station finding stations within 200 km of it, note
# that it is not necessary to provide an `api_key` for SILO queries of
# nearby stations.
wagga_stn <- find_nearby_stations(
latitude = -35.1583,
longitude = 147.4575,
distance_km = 200,
which_api = "silo"
)
## End(Not run)