Skip to contents

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.

Usage

extract_asc(
  xy,
  locations = NULL,
  lonlat = NULL,
  collection = "EV",
  api_key = nert::get_key(),
  ...
)

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.

collection

One or more ASC dataset collection variants. Defaults to "EV". Use c("EV", "CI") to retrieve both at once; each is returned in its own column (class and confusion_index, respectively), in the order requested. Options:

"EV"

(Estimated) Soil Order Class (character). The estimated ASC soil order class. Each pixel of the raster maps to one of 14 soil order classes: Vertosol, Sodosol, Dermosol, Chromosol, Ferrosol, Kurosol, Tenosol, Kandosol, Hydrosol, Podosol, Rudosol, Calcarasol, Organosol, Anthroposol. Default

"CI"

Confusion Index (0-1). A unitless index between 0.0 and 1.0, approximating the uncertainty of the Random Forest classification for the soil order at each pixel. (A higher value of the confusion index means that the classification at that pixel is more uncertain.)

api_key

A character string containing your API key, a random string provided to you by TERN, for the request. You may directly provide your key as a string here or use functionality like that from keyring. If nothing is provided, you will be prompted on how to set up your R session.

...

Other parameters passed to nert::read_asc, e.g., max_tries and initial_delay.

Value

A data.table::data.table() with the provided GPS coordinates and one column per requested collection, class (character) and/or confusion_index (numeric). Locations where the raster has no value return NA.

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