Skip to content

{extractOz}: Get local attribute information from GPS points for Australian agricultural research

License

Notifications You must be signed in to change notification settings

DPIRD-FSI/extractOz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fa91bf2 · Feb 27, 2023
Dec 13, 2022
Feb 17, 2023
Feb 27, 2023
Jan 1, 2023
Jan 1, 2023
Mar 23, 2022
May 27, 2022
May 27, 2022
May 27, 2022
Mar 23, 2022
Feb 27, 2023
Mar 19, 2022
Mar 21, 2022
Feb 27, 2023
Jan 1, 2023
Feb 27, 2023
Mar 19, 2022
May 27, 2022

Repository files navigation

extractOz

tic codecov Project Status: Active – The project has reached a stable, usable state and is being actively developed.

Extract the GRDC agroecological zone, major soil order and weather data from your GPS sampling points. Datasets for the GRDC agroecological zones and a modified Digital Atlas of Australian Soils are included in this package for ease of use. You may also use your own geospatial vector format file to extract similar information using the generic function, extract_area().

Quick start

if (!require("remotes")) {
  install.packages("remotes")
}

remotes::install_github("adamhsparks/extractOz", build_vignettes = TRUE)

library(extractOz)
library(dplyr)

Create locations in WA and NSW

locs <- data.frame(
  site = c("Merredin", "Corrigin", "Tamworth"),
  x = c(118.28, 117.87, 150.84),
  y = c(-31.48, -32.33, -31.07)
)

Extract the GRDC AgroEcological Zones

See ?extract_ae_zone() for more help on how to use this function.

z <- extract_ae_zone(x = locs, coords = c("x", "y"))

Extract the soil order

See ?extract_soil_order() for more help on how to use this function.

s <- extract_soil_order(x = locs, coords = c("x", "y"))

Get Weather Data for these Locations in 2020

Using the previously created data frame, fetch weather data from SILO for 2020. This is just an example, replace MY_EMAIL_ADDRESS with your email address below. See ?cropgrowdays::get_multi_silodata() from for more help on how to use this function.

three_sites  <-
  get_multi_silodata(
    latitude = locs$y,
    longitude = locs$x,
    Sitename = locs$site,
    START = "20200101",
    FINISH = "20201231",
    email = MY_EMAIL_ADDRESS
  )

Join the Weather Data with AE Zone, Soil Order and Site Information

Now using dplyr::left_join(), create a single data.frame() of the Site, GPS coordinates, agroecological zone and weather data.

left_join(z, three_sites, by = c("site" = "Sitename")) %>% 
  left_join(s)

Code of Conduct

Please note that the extractOz project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.