| Title: | Extract Australian Agricultural and Ecological Data from Publicly Available Data Set Using GPS Points |
|---|---|
| Description: | Extracts point data for a given GPS coordinate that includes soil data, weather data and GRDC agro-ecological zone information at that point in Australia. |
| Authors: | Adam H. Sparks [aut, cre] (ORCID: <https://orcid.org/0000-0002-0061-8359>), Western Australia Agriculture Authority (WAAA) [fnd, cph] (Provided support through Adam Sparks's time during development of 'extractOz'.), Curtin University [cph] (Provided support through Adam Sparks's time., ROR: <https://ror.org/02n415q13>), Grains Research and Development Corporation [fnd, cph] (GRDC Project CUR2210-005OPX (AAGI-CU), ROR: <https://ror.org/02xwr1996>) |
| Maintainer: | Adam H. Sparks <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.1.3 |
| Built: | 2026-06-09 13:47:25 UTC |
| Source: | https://codeberg.org/adamhsparks/fifo |
Extracts the Australian Agricultural and Grazing Industries Survey (AAGIS) zones and regions. These regions represent the finest level of geographical aggregation for which the ABARES farm survey is designed to produce reliable estimates.
extract_aagis_regions(xy, locations = NULL, lonlat = NULL)extract_aagis_regions(xy, locations = NULL, lonlat = NULL)
xy |
A |
locations |
The column in which the location names are located as an
|
lonlat |
A |
A data.table::data.table() with the provided GPS
coordinates and the respective region(s)' name(s) and zone(s).
If xy is a list object, each individual vector's items should be named
“x” (longitude) and “y” (latitude), respectively. The list
item names should be descriptive of the individual vectors and will be
included in a “location” column of the output.
If xy is a data.frame, it should be a three column object with the first
column being the location name, the second longitude and the third,
latitude both as decimal degrees in numeric format.
If xy is an sf object, it should only be point geometry. If the
data are projected, they will be reprojected to "EPSG:4326", Geographic
Coordinate System WGS 84 before the extraction.
The coordinate reference system for the AAGIS regions is internally converted to EPSG:4326 (WGS 84) for spatial intersection and ease of combining the returned values with other values from fifo.
https://www.agriculture.gov.au/sites/default/files/documents/aagis_asgs16v1_g5a.shp_.zip
https://www.agriculture.gov.au/abares/research-topics/surveys/farm-definitions-methods#regions
locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_aagis_regions(xy = locs)locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_aagis_regions(xy = locs)
Extract GRDC agroecological zones using Australian GPS coordinates
extract_ae_zone(xy, locations = NULL, lonlat = NULL)extract_ae_zone(xy, locations = NULL, lonlat = NULL)
xy |
A |
locations |
The column in which the location names are located as an
|
lonlat |
A |
A data.table::data.table() with the provided GPS
coordinates and the respective GRDC agroecological zone.
If xy is a list object, each individual vector's items should be named
“x” (longitude) and “y” (latitude), respectively. The list
item names should be descriptive of the individual vectors and will be
included in a “location” column of the output.
If xy is a data.frame, it should be a three column object with the first
column being the location name, the second longitude and the third,
latitude both as decimal degrees in numeric format.
If xy is an sf object, it should only be point geometry. If the
data are projected, they will be reprojected to "EPSG:4326", Geographic
Coordinate System WGS 84 before the extraction.
locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_ae_zone(xy = locs)locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_ae_zone(xy = locs)
A generic function to extract an area of interest for user-provided GPS coordinates.
extract_area(xy, spatial, area, locations = NULL, lonlat = NULL)extract_area(xy, spatial, area, locations = NULL, lonlat = NULL)
xy |
A |
spatial |
a user-supplied |
area |
the field in |
locations |
The column in which the location names are located as an
|
lonlat |
A |
A data.table::data.table() with the provided GPS
coordinates and the respective area value from spatial.
If xy is a list object, each individual vector's items should be named
“x” (longitude) and “y” (latitude), respectively. The list
item names should be descriptive of the individual vectors and will be
included in a “location” column of the output.
If xy is a data.frame, it should be a three column object with the first
column being the location name, the second longitude and the third,
latitude both as decimal degrees in numeric format.
If xy is an sf object, it should only be point geometry. If the
data are projected, they will be reprojected to "EPSG:4326", Geographic
Coordinate System WGS 84 before the extraction.
# load the `aez` data included in the package for use in example only. # the `extract_ae_zone()` performs this exact task, this is strictly for # demonstration purposes only library(sf) aez <- st_read(system.file( "extdata", "aez.gpkg", package = "fifo", mustWork = TRUE )) locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_area(xy = locs, spatial = aez, area = "AEZ")# load the `aez` data included in the package for use in example only. # the `extract_ae_zone()` performs this exact task, this is strictly for # demonstration purposes only library(sf) aez <- st_read(system.file( "extdata", "aez.gpkg", package = "fifo", mustWork = TRUE )) locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_area(xy = locs, spatial = aez, area = "AEZ")
Extracts the Australian Soil Class data at the GPS points provided, assuming that they are land-based coordinates in Australia from the Australian Soil Class (ASC). Values for the Confusion Index, the amount of model certainty around the soil class at that grid cell, are also supported.
extract_asc( xy, locations = NULL, lonlat = NULL, confusion_index = FALSE, api_key = nert::get_key(), max_tries = 3L, initial_delay = 1L )extract_asc( xy, locations = NULL, lonlat = NULL, confusion_index = FALSE, api_key = nert::get_key(), max_tries = 3L, initial_delay = 1L )
xy |
A |
locations |
The column in which the location names are located as an
|
lonlat |
A |
confusion_index |
|
api_key |
A |
max_tries |
An integer |
initial_delay |
An |
A data.table::data.table() with the provided GPS
coordinates and the respective Australian Soil Class for the coordinates
from the ASC data ("asc_longitude" and "asc_latitude").
If xy is a list object, each individual vector's items should be named
“x” (longitude) and “y” (latitude), respectively. The list
item names should be descriptive of the individual vectors and will be
included in a “location” column of the output.
If xy is a data.frame, it should be a three column object with the first
column being the location name, the second longitude and the third,
latitude both as decimal degrees in numeric format.
If xy is an sf object, it should only be point geometry. If the
data are projected, they will be reprojected to "EPSG:4326", Geographic
Coordinate System WGS 84 before the extraction.
You must be logged in to view these.
https://portal.tern.org.au/metadata/TERN/15728dba-b49c-4da5-9073-13d8abe67d7c
locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_asc(xy = locs, confusion_index = TRUE)locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_asc(xy = locs, confusion_index = TRUE)
This function has been superseded by extract_asc(), which provides access
to a more accurate dataset based on the Australian Soil Classification (ASC).
Extracts the major soil order at the GPS points provided assuming that they are land-based coordinates.
extract_daas_soil_order(xy, locations = NULL, lonlat = NULL)extract_daas_soil_order(xy, locations = NULL, lonlat = NULL)
xy |
A |
locations |
The column in which the location names are located as an
|
lonlat |
A |
A data.table::data.table() with the provided GPS
coordinates and the respective Digital Atlas of Australian Soils
(DAAS soil order), "Spatial Data Conversion of the Atlas of
Australian Soils to the Australian Soil Classification v01".
If xy is a list object, each individual vector's items should be named
“x” (longitude) and “y” (latitude), respectively. The list
item names should be descriptive of the individual vectors and will be
included in a “location” column of the output.
If xy is a data.frame, it should be a three column object with the first
column being the location name, the second longitude and the third,
latitude both as decimal degrees in numeric format.
If xy is an sf object, it should only be point geometry. If the
data are projected, they will be reprojected to "EPSG:4326", Geographic
Coordinate System WGS 84 before the extraction.
https://data.gov.au/data/dataset/2d0809ec-34c8-4e66-8cef-e3de2416c144
locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_daas_soil_order(xy = locs)locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_daas_soil_order(xy = locs)
A modified wrapper version of weatherOz::get_data_drill that allows for fetching many geophysical points or a single geophysical point. Extracts interpolated weather data from the SILO API from the gridded data, PatchedPointData, data set.
extract_data_drill( xy, locations = NULL, lonlat = NULL, start_date, end_date, values = "all", api_key = weatherOz::get_key(service = "SILO") )extract_data_drill( xy, locations = NULL, lonlat = NULL, start_date, end_date, values = "all", api_key = weatherOz::get_key(service = "SILO") )
xy |
A |
locations |
The column in which the location names are located as an
|
lonlat |
A |
start_date |
A |
end_date |
A |
values |
A |
api_key |
A |
A data.table::data.table() with the weather data queried with the
weather variables in alphabetical order. The first eight columns will
always be:
longitude,
latitude,
elev_m (elevation in metres),
date (ISO8601 format, YYYYMMDD),
year,
month,
day,
extracted (the date on which the query was made)
Which will return all of the following values
Rainfall
Maximum temperature
Minimum temperature
Vapour pressure
Vapour pressure deficit
Class A pan evaporation
Synthetic estimate1
Combination (synthetic estimate pre-1970, class A pan 1970 onwards)
Morton's shallow lake evaporation
Solar exposure, consisting of both direct and diffuse components
Relative humidity at the time of maximum temperature
Relative humidity at the time of minimum temperature
short crop
tall crop6
Morton's areal actual evapotranspiration
Morton's point potential evapotranspiration
Morton's wet-environment areal potential evapotranspiration over land
Mean sea level pressure
Solar radiation: total incoming downward shortwave radiation on a horizontal surface, derived from estimates of cloud oktas and sunshine duration3.
Relative humidity: calculated using the vapour pressure measured at 9am, and the saturation vapour pressure computed using either the maximum or minimum temperature6.
Evaporation and evapotranspiration: an overview of the variables provided by SILO is available here, https://data.longpaddock.qld.gov.au/static/publications/Evapotranspiration_overview.pdf.
Data codes Where possible (depending on the file format), the data are supplied with codes indicating how each datum was obtained.
Official observation as supplied by the Bureau of Meteorology
Deaccumulated rainfall (original observation was recorded over a period exceeding the standard 24 hour observation period)
Interpolated from daily observations for that date
Synthetic Class A pan evaporation, calculated from temperatures, radiation and vapour pressure
Interpolated from daily observations using an anomaly interpolation method
Interpolated from the long term averages of daily observations for that day of year
If xy is a list object, each individual vector's items should be named
“x” (longitude) and “y” (latitude), respectively. The list
item names should be descriptive of the individual vectors and will be
included in a “location” column of the output.
If xy is a data.frame, it should be a three column object with the first
column being the location name, the second longitude and the third,
latitude both as decimal degrees in numeric format.
If xy is an sf object, it should only be point geometry. If the
data are projected, they will be reprojected to "EPSG:4326", Geographic
Coordinate System WGS 84 before the extraction.
Adam H. Sparks, [email protected]
Rayner, D. (2005). Australian synthetic daily Class A pan evaporation. Technical Report December 2005, Queensland Department of Natural Resources and Mines, Indooroopilly, Qld., Australia, 40 pp.
Morton, F. I. (1983). Operational estimates of areal evapotranspiration and their significance to the science and practice of hydrology, Journal of Hydrology, Volume 66, 1-76.
Zajaczkowski, J., Wong, K., & Carter, J. (2013). Improved historical solar radiation gridded data for Australia, Environmental Modelling & Software, Volume 49, 64–77. DOI: doi:10.1016/j.envsoft.2013.06.013.
Food and Agriculture Organization of the United Nations, Irrigation and drainage paper 56: Crop evapotranspiration - Guidelines for computing crop water requirements, 1998.
ASCE’s Standardized Reference Evapotranspiration Equation, proceedings of the National Irrigation Symposium, Phoenix, Arizona, 2000.
For further details refer to Jeffrey, S.J., Carter, J.O., Moodie, K.B. and Beswick, A.R. (2001). Using spatial interpolation to construct a comprehensive archive of Australian climate data, Environmental Modelling and Software, Volume 16/4, 309-330. DOI: doi:10.1016/S1364-8152(01)00008-1.
Other weather data:
extract_patched_point()
Other SILO:
extract_patched_point()
## Not run: # Source data from a list of latitude and longitude coordinates in NSW # and WA locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) wd <- extract_data_drill( xy = locs, start_date = "20211001", end_date = "20211201", values = "all", api_key = "your_api_key" ) ## End(Not run)## Not run: # Source data from a list of latitude and longitude coordinates in NSW # and WA locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) wd <- extract_data_drill( xy = locs, start_date = "20211001", end_date = "20211201", values = "all", api_key = "your_api_key" ) ## End(Not run)
Extracts station-based weather data for the provided dates from the nearest
weather station to the provided longitude and latitude values in x.
Weather data for the single closest station(s) to the provided longitude
and latitude will always be returned.
extract_patched_point( xy, locations = NULL, lonlat = NULL, start_date, end_date, n_stations = 1L, values = "all", api_key = weatherOz::get_key(service = "SILO") )extract_patched_point( xy, locations = NULL, lonlat = NULL, start_date, end_date, n_stations = 1L, values = "all", api_key = weatherOz::get_key(service = "SILO") )
xy |
A |
locations |
The column in which the location names are located as an
|
lonlat |
A |
start_date |
A |
end_date |
A |
n_stations |
An |
values |
A |
api_key |
A |
A data.table::data.table() with the weather data queried with the
weather variables in alphabetical order. The first eight columns will
always be:
location,
x (longitude of location),
y (latitude of location),
station_code,
station_name,
year,
day,
date (ISO8601 format, "YYYYMMDD").
Column names are converted from the default returns of the API to be
snake_case formatted and where appropriate, the names of the values that
are analogous between SILO and DPIRD data are named
using the same name for ease of interoperability, e.g., using
rbind() to create a data.table that contains data from both APIs.
The SILO documentation provides the following information for the PatchedPoint data.
These data are a continuous daily time series of data at either recording stations or grid points across Australia:
Data at station locations consists of observational records which have been supplemented by interpolated estimates when observed data are missing. Datasets are available at approximately 8,000 Bureau of Meteorology recording stations around Australia.
Data at grid points consists entirely of interpolated estimates. The data are taken from the SILO gridded datasets and are available at any pixel on a 0.05° × 0.05° grid over the land area of Australia (including some islands).
Which will return all of the following values
Rainfall
Maximum temperature
Minimum temperature
Vapour pressure
Vapour pressure deficit
Class A pan evaporation
Synthetic estimate1
Combination (synthetic estimate pre-1970, class A pan 1970 onwards)
Morton's shallow lake evaporation
Solar exposure, consisting of both direct and diffuse components
Relative humidity at the time of maximum temperature
Relative humidity at the time of minimum temperature
short crop
tall crop6
Morton's areal actual evapotranspiration
Morton's point potential evapotranspiration
Morton's wet-environment areal potential evapotranspiration over land
Mean sea level pressure
The resulting data.table::data.table may contain duplicated weather values
depending on the distance from each location to the nearest station,
i.e. one station may be the closest station to more than one
queried location. Therefore, the final data.frame will have the same weather
data for multiple locations as provided in xy.
Solar radiation: total incoming downward shortwave radiation on a horizontal surface, derived from estimates of cloud oktas and sunshine duration3.
Relative humidity: calculated using the vapour pressure measured at 9am, and the saturation vapour pressure computed using either the maximum or minimum temperature6.
Evaporation and evapotranspiration: an overview of the variables provided by SILO is available here, https://data.longpaddock.qld.gov.au/static/publications/Evapotranspiration_overview.pdf.
The data are supplied with codes indicating how each datum was obtained.
Official observation as supplied by the Bureau of Meteorology
Deaccumulated rainfall (original observation was recorded over a period exceeding the standard 24 hour observation period).
Interpolated from daily observations for that date.
Synthetic Class A pan evaporation, calculated from temperatures, radiation and vapour pressure.
Interpolated from daily observations using an anomaly interpolation method.
Interpolated from the long term averages of daily observations for that day of year.
If xy is a list object, each individual vector's items should be named
“x” (longitude) and “y” (latitude), respectively. The list
item names should be descriptive of the individual vectors and will be
included in a “location” column of the output.
If xy is a data.frame, it should be a three column object with the first
column being the location name, the second longitude and the third,
latitude both as decimal degrees in numeric format.
If xy is an sf object, it should only be point geometry. If the
data are projected, they will be reprojected to "EPSG:4326", Geographic
Coordinate System WGS 84 before the extraction.
Adam H. Sparks, [email protected]
Rayner, D. (2005). Australian synthetic daily Class A pan evaporation. Technical Report December 2005, Queensland Department of Natural Resources and Mines, Indooroopilly, Qld., Australia, 40 pp.
Morton, F. I. (1983). Operational estimates of areal evapotranspiration and their significance to the science and practice of hydrology, Journal of Hydrology, Volume 66, 1-76.
Zajaczkowski, J., Wong, K., & Carter, J. (2013). Improved historical solar radiation gridded data for Australia, Environmental Modelling & Software, Volume 49, 64–77. DOI: doi:10.1016/j.envsoft.2013.06.013.
Food and Agriculture Organization of the United Nations, Irrigation and drainage paper 56: Crop evapotranspiration - Guidelines for computing crop water requirements, 1998.
ASCE’s Standardized Reference Evapotranspiration Equation, proceedings of the National Irrigation Symposium, Phoenix, Arizona, 2000.
For further details refer to Jeffrey, S.J., Carter, J.O., Moodie, K.B. and Beswick, A.R. (2001). Using spatial interpolation to construct a comprehensive archive of Australian climate data, Environmental Modelling and Software, Volume 16/4, 309-330. DOI: doi:10.1016/S1364-8152(01)00008-1.
Other weather data:
extract_data_drill()
Other SILO:
extract_data_drill()
## Not run: # Source data from a list of latitude and longitude coordinates in NSW & WA locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) # Replace "your_api_key" with a valid email address. w <- extract_patched_point( xy = locs, start_date = "20210101", end_date = "20210131", api_key = "your_api_key" ) ## End(Not run)## Not run: # Source data from a list of latitude and longitude coordinates in NSW & WA locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) # Replace "your_api_key" with a valid email address. w <- extract_patched_point( xy = locs, start_date = "20210101", end_date = "20210131", api_key = "your_api_key" ) ## End(Not run)
Extracts the soil moisture at the GPS points provided assuming that they are land-based coordinates in Australia from the Soil Moisture Integration and Prediction System SMIPS data set.
extract_smips( xy, day, locations = NULL, lonlat = NULL, collection = "totalbucket", api_key = nert::get_key(), max_tries = 3L, initial_delay = 1L )extract_smips( xy, day, locations = NULL, lonlat = NULL, collection = "totalbucket", api_key = nert::get_key(), max_tries = 3L, initial_delay = 1L )
xy |
A |
day |
A vector of date(s) to query, e.g., |
locations |
The column in which the location names are located as an
|
lonlat |
A |
collection |
A character vector of the data collection to be queried, currently only “smips” is supported with the following collections:
Defaults to “totalbucket”. Multiple collections are supported,
e.g., |
api_key |
A |
max_tries |
An integer |
initial_delay |
An |
A data.table::data.table() with the provided GPS
coordinates and the respective soil moisture data from SMIPS and
coordinates from the SMIPS ("smips_longitude" and
"smips_latitude").
If xy is a list object, each individual vector's items should be named
“x” (longitude) and “y” (latitude), respectively. The list
item names should be descriptive of the individual vectors and will be
included in a “location” column of the output.
If xy is a data.frame, it should be a three column object with the first
column being the location name, the second longitude and the third,
latitude both as decimal degrees in numeric format.
If xy is an sf object, it should only be point geometry. If the
data are projected, they will be reprojected to "EPSG:4326", Geographic
Coordinate System WGS 84 before the extraction.
You must be logged in to view this. https://data.tern.org.au/model-derived/smips/v1_0/
https://portal.tern.org.au/metadata/TERN/d1995ee8-53f0-4a7d-91c2-ad5e4a23e5e0
locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_smips(xy = locs, day = "2023-09-23")locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_smips(xy = locs, day = "2023-09-23")
Extracts the soil thickness for Australian areas of intensive Agriculture of Layer 1 (A Horizon - top-soil) (derived from soil mapping) at the GPS points provided, assuming that they are land-based coordinates in Australia from the Soil Thickness for Australian Areas of Intensive Agriculture of Layer 1 data set on a 0.01 X 0.01 arc-degree quadrat.
extract_topsoil_thickness(xy, locations = NULL, lonlat = NULL)extract_topsoil_thickness(xy, locations = NULL, lonlat = NULL)
xy |
A |
locations |
The column in which the location names are located as an
|
lonlat |
A |
A data.table::data.table with the provided GPS
coordinates and the respective soil thickness data (mm) as an Integer
value of the soil layer 1 from Soil Thickness for Australian Areas of
Intensive Agriculture of Layer 1 and coordinates from the Soil Thickness
("thpk_1_longitude" and "thpk_1_latitude").
If xy is a list object, each individual vector's items should be named
“x” (longitude) and “y” (latitude), respectively. The list
item names should be descriptive of the individual vectors and will be
included in a “location” column of the output.
If xy is a data.frame, it should be a three column object with the first
column being the location name, the second longitude and the third,
latitude both as decimal degrees in numeric format.
If xy is an sf object, it should only be point geometry. If the
data are projected, they will be reprojected to "EPSG:4326", Geographic
Coordinate System WGS 84 before the extraction.
locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_topsoil_thickness(xy = locs)locs <- list( "Merredin" = c(x = 118.28, y = -31.48), "Corrigin" = c(x = 117.87, y = -32.33), "Tamworth" = c(x = 150.84, y = -31.07) ) extract_topsoil_thickness(xy = locs)