Skip to contents

A function to retrieve the definitions for one or more geologic map sources in the Macrostrat database. By default, all source definitions are returned.

Usage

def_sources(
  source_id = NULL,
  lat = NULL,
  lng = NULL,
  shape = NULL,
  buffer = NULL,
  scale = NULL,
  sf = TRUE
)

Arguments

source_id

integer. The unique identification number(s) of the desired source(s) to return a definition for.

lat

numeric. A valid latitude in decimal degrees to return a source definition for. Must also supply lng.

lng

numeric. A valid longitude in decimal degrees to return a source definition for. Must also supply lat.

shape

character. A valid well-known text (WKT) representation of geometry, such as "POINT(30 10)" or "POLYGON((30 10, 40 40, 20 40, 10 20))", to return a source definition for.

buffer

integer. The geographic buffer (in meters) that should be applied to the specified shape.

scale

character. The desired Burwell scale, either: "tiny" (global), "small" (continental), "medium" (regional), or "large" (local).

sf

logical. Should the results be returned as an sf object? Defaults to TRUE. If FALSE, a data.frame is returned.

Value

A data.frame containing the following columns:

  • source_id: Identification number of the geologic map source.

  • name: Name of the geologic map source.

  • url: URL where additional information, the source, or contributing publication can be found.

  • ref_title: Title of reference for geologic map source.

  • authors: Authors of geologic map source.

  • ref_year: Year of reference publication.

  • ref_source: Original publication source of the reference.

  • isbn_doi: The ISBN or DOI for the reference.

  • scale: The Macrostrat scale the geologic map source belongs to.

  • features: The total number of features (i.e., outcrop shape and point elements) associated with the geologic map source.

  • area: The total geographic area of the geologic map source in km2.

If sf is TRUE (the default), an sf object is returned instead, with the same columns plus a "geometry" column that contains the spatial data.

Developer(s)

William Gearty

Reviewer(s)

Lewis A. Jones

See also

Geologic maps: get_map_legends(), get_map_outcrop(), get_map_points()

Macrostrat database metadata: def_projects(), def_references(), get_stats()

Examples

# \donttest{
# Get all sources
ex1 <- def_sources()
# Get subset of sources
ex2 <- def_sources(source_id = c(1,2,4))
ex3 <- def_sources(lat = 43.03, lng = -89.4, scale = "large")
# Use WKT representation
library(sf)
#> Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE
line <- st_linestring(x = matrix(c(-122.3438, 37,-89.3527, 43.0582),
                                 byrow = TRUE, ncol = 2))
ex4 <- def_sources(shape = st_as_text(line), buffer = 100)
# }