checkCoord: Check Geographical Coordinates

View source: R/checkCoord.R

checkCoordR Documentation

Check Geographical Coordinates

Description

This function makes the check of the coordinates against the world and Latin-American maps. Optionally, it returns the distance between the original coordinates and those from a gazetteer for coordinates not validated at the county level.

Usage

checkCoord(
  x,
  lon = "decimalLongitude.new",
  lat = "decimalLatitude.new",
  str.name = "loc.correct",
  orig.coord = "origin.coord",
  low.map = "plantR",
  high.map = "plantR",
  res.gazet = "resolution.gazetteer",
  dist.center = FALSE,
  lon.gazet = "longitude.gazetteer",
  lat.gazet = "latitude.gazetteer",
  keep.cols = c("geo.check", "distCentroid_m")
)

Arguments

x

a data frame with the species records and their coordinates in decimal degrees.

lon

Name of the column with the longitude to be validated. Default to 'decimalLongitude.new'

lat

Name of the column with the latitude to be validated. Default to 'decimalLatitude.new'

str.name

Column with the verified locality search string

orig.coord

Column with the origin of the coordinates (typically the output of function getCoord())

low.map

a sf multipolygon object containing the global administrative map at the lowest level (e.g. country). The default is "plantR", the default map obtained from [GADM]https://gadm.org (see worldMap).

high.map

a sf multipolygon object or a list of sf objects containing the regional map at the highest administrative level (e.g. municipality). The default is "plantR", the map for all Latin American countries and dependent territories obtained [GADM]https://gadm.org (see latamMap).

res.gazet

Column with the locality resolution level retrieved from the gazetteer

dist.center

Logical. Should the distance (in meters) between the original coordinates and those retrieved in the gazetteer be returned? Defaults to FALSE.

lon.gazet

Column with the longitude obtained from a gazetteer

lat.gazet

Column with the latitude obtained from a gazetteer

keep.cols

character. Name of columns that should be kept in the output.

Details

By default the function returns only the geographical validation column ('geo.check') and the distance between the original coordinates and those from a gazetteer, if dist.center is TRUE. Other columns available for the output that may be relevant are:

  • the name administrative levels obtained from the maps: 'NAME_0', 'NAME_1', 'NAME_2' and 'NAME_3';

  • the locality string in the plantR format combining the locality obtained from the maps: 'loc.coord';

  • the checks between the locality info obtained from str.name and the administrative levels from the maps: 'country.check', 'state.check' and 'county.check'.

By default, a global map and a regional for Latin America are used in the validation of the geographical coordinates. But, different maps than the plantR defaults can be used. These maps must be provided using the arguments low.map and high.map. Ideally, these maps which should have the same format of the locality information in the gazetteer used for the validation of the locality information (see function getLoc() and the default plantR maps 'worldMap' and 'latamMap').

Author(s)

Andrea Sánchez-Tapia, Sara Mortara & Renato A. F. de Lima


LimaRAF/plantR documentation built on Jan. 1, 2023, 10:18 a.m.