find_stations_in {weatherOz} | R Documentation |
Find Stations Within a Geospatially Defined Geographic Area of Interest
Description
Given an sf polygon or a bounding box as a vector with the minimum and maximum longitude and latitude values, find DPIRD or BOM stations in the SILO network that fall within that defined area or the station nearest the centroid of the area of interest.
Usage
find_stations_in(
x,
centroid = FALSE,
api_key = NULL,
which_api = "all",
include_closed = FALSE,
crs = "EPSG:7844"
)
Arguments
x |
One of three types of object:
|
centroid |
|
api_key |
A |
which_api |
A |
include_closed |
A |
crs |
A |
Value
a data.table object of weather station(s) within the defined area of interest in an unprojected format, EPSG:4326, WGS 84 – WGS84 - World Geodetic System 1984, used in GPS format.
See Also
Other DPIRD:
dpird_extreme_weather_values
,
dpird_minute_values
,
dpird_summary_values
,
find_nearby_stations()
,
get_dpird_apsim()
,
get_dpird_availability()
,
get_dpird_extremes()
,
get_dpird_minute()
,
get_dpird_summaries()
,
get_stations_metadata()
Other SILO:
find_nearby_stations()
,
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_nearby_stations()
,
get_available_imagery()
,
get_available_radar()
,
get_dpird_availability()
,
get_stations_metadata()
Examples
# using a (generous) bounding box for Melbourne, Vic using only the SILO API
# for BOM stations, so no API key is needed.
bbox <- find_stations_in(
x = c(144.470215, -38.160476, 145.612793, -37.622934),
which_api = "SILO",
include_closed = TRUE
)
bbox
# Use the same bounding box but only find a single station nearest
# the centroid using only the SILO API for BOM stations
centroid <- find_stations_in(
x = c(144.470215, -38.160476, 145.612793, -37.622934),
which_api = "SILO",
include_closed = TRUE,
centroid = TRUE
)
centroid
# Use the `south_west_agricultural_region` data to fetch stations only in the
# south-western portion of WA and plot it with {ggplot2} showing open/closed
# stations just to be sure they're inside the area of interest.
# As this is in WA, we can use the DPIRD network, so we need our API key.
# Using the `south_west_agricultural_region` {sf} object provided.
sw_wa <- find_stations_in(
x = south_west_agricultural_region,
api_key = "your_api_key",
include_closed = TRUE
)
sw_wa