round_coordinates: Round coordinates to generalize camera trap locations

View source: R/round_coordinates.R

round_coordinatesR Documentation

Round coordinates to generalize camera trap locations

Description

Rounds deployment coordinates to a certain number of digits to fuzzy/generalize camera trap locations. This function can be used before publishing data in order to protect sensitive species and/or prevent theft of active cameras.

Usage

round_coordinates(x, digits)

Arguments

x

Camera Trap Data Package object, as returned by read_camtrapdp().

digits

Number of decimal places to round coordinates to (1, 2 or 3).

Value

x with chosen coordinatePrecision in metadata and rounded coordinates and calculated coordinateUncertainty in deployments.

Details

Rounding coordinates is a recommended method to generalize sensitive biodiversity information (see Section 4.2 in Chapman 2020). Use this function to do so for your data. Determine the category of sensitivity (see Section 2.2 in Chapman 2020) and choose the associated number of digits :

category sensitivity digits
category 1 extreme (do not publish)
category 2 high 1
category 3 medium 2
category 4 low 3
not sensitive not sensitive all (do not use this function)

The function will:

  1. Set the coordinatePrecision in the metadata (original values will be overwritten):

    digits coordinatePrecision
    1 0.1
    2 0.01
    3 0.001
  2. Round all coordinates in the deployments to the selected number of digits.

  3. Update the coordinateUncertainy (in meters) in the deployments. This uncertainty is based on the number of digits and the latitude, following Table 3 in Chapman & Wieczorek 2020:

    digits 0° latitude 30° latitude 60° latitude 85° latitude
    1 15691 m 14697 m 12461 m 11211 m
    2 1570 m 1470 m 1246 m 1121 m
    3 157 m 147 m 125 m 112 m

    If a coordinatePrecision is already present, the function will subtract the coordinateUncertainty associated with it before setting a new uncertainty (e.g. 0.001 to 0.01 = ⁠original value - 157 + 1570 m⁠). If ⁠original value⁠ is NA, the function will assume the coordinates were obtained by GPS and set ⁠original value = 30⁠.

See Also

Other transformation functions: merge_camtrapdp(), shift_time(), write_dwc(), write_eml()

Examples

x <- example_dataset()

# Original precision
x$coordinatePrecision

# Original coordinates and uncertainty
deployments(x)[c("latitude", "longitude", "coordinateUncertainty")]

# Round coordinates to 1 digit
x_rounded <- round_coordinates(x, 1)

# Updated coordinatePrecision
x_rounded$coordinatePrecision

# Updated coordinates and uncertainty (original 187 - 147 + 14697 = 14737)
deployments(x_rounded)[c("latitude", "longitude", "coordinateUncertainty")]

inbo/camtrapdp documentation built on Dec. 20, 2024, 3:31 a.m.