Use this function to extract the unique location coordinates and names from a table or to create a blank template to manually fill.

template_geographic_coverage(
  path,
  data.path = path,
  data.table,
  lat.col,
  lon.col,
  site.col,
  empty = FALSE,
  write.file = TRUE,
  x = NULL
)

Arguments

path

(character) Path to the metadata template directory.

data.path

(character) Path to the data directory.

data.table

(character) Table name containing geographic coordinates.

lat.col

(character) Column name containing latitude coordinates in decimal degrees, where latitudes south of the equator are negative.

lon.col

(character) Column name containing longitude coordinates in decimal degrees, where longitudes west of the prime meridian are negative.

site.col

(character) Column name containing site names.

empty

(logical) Whether to write an empty template file.

write.file

(logical; optional) Whether to write the template file.

x

(named list; optional) Alternative input to template_geographical_coverage(). Use template_arguments() to create x.

Value

geographical_coverage

Columns:

  • geographicDescription: Brief description of location.

  • northBoundingCoordinate: North coordinate

  • southBoundingCoordinate: South coordinate

  • eastBoundingCoordinate: East coordinate

  • westBoundingCoordinate: West coordinate

Details

Character encoding of metadata extracted directly from the tables are converted to UTF-8 via enc2utf8().

Examples

if (FALSE) {
# Set working directory
setwd("/Users/me/Documents/data_packages/pkg_260")

# For a table containing site coordinates and names
template_geographic_coverage(
  path = "./metadata_templates",
  data.path = "./data_objects",
  data.table = "nitrogen.csv",
  site.col = "site_name",
  lat.col = "site_lat",
  lon.col = "site_lon")
  
# For returning an empty template to be filled manually
template_geographic_coverage(
  path = "./metadata_templates",
  empty = TRUE)
}