table_addCoreMetadata: Add missing core metadata columns to a known location table

View source: R/table_addCoreMetadata.R

table_addCoreMetadataR Documentation

Add missing core metadata columns to a known location table

Description

An existing table will be amended to guarantee that it includes the following core metadata columns.

  • locationID

  • locationName

  • longitude

  • latitude

  • elevation

  • countryCode

  • stateCode

  • countyName

  • timezone

  • houseNumber

  • street

  • city

  • postalCode

The longitude and latitude columns are required to exist in the incoming tibble but all others are optional.

If any of these core metadata columns are found, they will be retained.

The locationID will be generated (anew if already found) from existing longitude and latitude data.

Other core metadata columns will be filled with NA values of the proper type.

The result is a tibble with all of the core metadata columns. Theses columns must then be filled in to create a usable "known locations" table.

Usage

table_addCoreMetadata(locationTbl = NULL, precision = 10)

Arguments

locationTbl

Tibble of known locations. This input tibble need not be a standardized "known location" with all required columns. They will be added.

precision

precision argument passed on to location_createID.

Value

Tibble with the metadata columns required in a "known locations" table.

Note

No check is performed for overlapping locations. The returned tibble has the structure of a "known locations" table and is a good starting place for investigation. But further work is required to produce a valid table of "known locations" associated with a specific spatial scale.


MazamaLocationUtils documentation built on Sept. 11, 2024, 9:08 p.m.