Skip to contents

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.

Usage

extract_topsoil_thickness(xy, locations = NULL, lonlat = NULL)

Arguments

xy

A list or data.frame object with names containing pairings of longitude and latitude values expressed as decimal degree values in that order. A data.frame may also be an sf points object. See Details for more.

locations

The column in which the location names are located as an Integer value. Defaults to 1.

lonlat

A vector of integer values indicating the column index in which the longitude and latitude values are contained. Defaults to 2:3.

Value

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 (thpk_1) and the coordinates of the centre of the grid cell from which the value was taken (thpk_x and thpk_y).

xy

xy as a List Object

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.

xy as a Data Frame Object

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.

xy as an sf Object

If xy is an sf object, it should only be point geometry and have a coordinate reference system. The points are reprojected to the coordinate reference system of fifo's AEZ boundaries before the extraction. The x and y columns of every extract_*() function are returned in this same coordinate reference system. The location names are taken from the column given in locations, or from a column named “location” if there is one, otherwise the row numbers are used.

Examples

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)
#>    location      x      y thpk_1 thpk_x thpk_y
#>      <char>  <num>  <num>  <int>  <num>  <num>
#> 1: Corrigin 117.87 -32.33    202 117.87 -32.33
#> 2: Merredin 118.28 -31.48    150 118.28 -31.48
#> 3: Tamworth 150.84 -31.07    150 150.84 -31.07