R/template_geographic_coverage.R
template_geographic_coverage.Rd
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
)
(character) Path to the metadata template directory.
(character) Path to the data directory.
(character) Table name containing geographic coordinates.
(character) Column name containing latitude coordinates in decimal degrees, where latitudes south of the equator are negative.
(character) Column name containing longitude coordinates in decimal degrees, where longitudes west of the prime meridian are negative.
(character) Column name containing site names.
(logical) Whether to write an empty template file.
(logical; optional) Whether to write the template file.
(named list; optional) Alternative input to
template_geographical_coverage()
. Use template_arguments()
to create x
.
Columns:
geographicDescription: Brief description of location.
northBoundingCoordinate: North coordinate
southBoundingCoordinate: South coordinate
eastBoundingCoordinate: East coordinate
westBoundingCoordinate: West coordinate
Character encoding of metadata extracted directly from the tables are
converted to UTF-8 via enc2utf8()
.
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)
}