Skip to contents

This function calculates the precision of geographic coordinates.

Usage

dwc_coordinatePrecision(
  verbatimLongitude,
  verbatimLatitude,
  verbatimCoordinateSystem
)

Arguments

verbatimLongitude

Output of dwc_coordinates. See: http://rs.tdwg.org/dwc/terms/verbatimLongitude.

verbatimLatitude

Output of dwc_coordinates. See: http://rs.tdwg.org/dwc/terms/verbatimLatitude.

verbatimCoordinateSystem

The format of the longitude and latitude coordinates. Supported terms are "decimal degrees", "degrees decimal minutes" or "degrees minutes seconds". See: http://rs.tdwg.org/dwc/terms/verbatimCoordinateSystem

Value

A numeric. A value that can be used in the Darwin Core coordinatePrecision field. See: http://rs.tdwg.org/dwc/terms/coordinatePrecision. The maximum precision returned is 0.00001 degrees, or approximately 1.11 m at the equator.

Examples

# For a single point
dwc_coordinatePrecision(144.9786, -41.17472,
  verbatimCoordinateSystem = "decimal degrees"
)
#> [1] 1e-05

# For a set of points
data("thylacine_data")
thylacine_data |>
  dplyr::mutate(
    coordinatePrecision =
      dwc_coordinatePrecision(
        verbatimLatitude = latitude_dd,
        verbatimLongitude = longitude_dd,
        verbatimCoordinateSystem = "decimal degrees"
      )
  )
#> # A tibble: 8 × 14
#>   site   trap     date_trap_setup   date_trap_collected longitude_dd latitude_dd
#>   <chr>  <chr>    <chr>             <chr>                      <dbl>       <dbl>
#> 1 Sumac  Sumac 1  05/09/2022 10:32… 06/09/2022 12:24:00         145.       -41.2
#> 2 Sumac  Sumac 2  05/09/2022 12:15… 06/09/2022 14:57:00         145.       -41.2
#> 3 Sumac  Sumac 1  05/10/2022 08:23… 06/10/2022 0:00:00          145.       -41.2
#> 4 Sumac  Sumac 2  05/10/2022 10:14… 06/10/2022 10:29:00         145.       -41.2
#> 5 Picton Picton 1 10/09/2022 10:32… 11/09/2022 12:24:00         147.       -43.3
#> 6 Picton Picton 2 10/09/2022 12:15… 11/09/2022 14:57:00         147.       -43.2
#> 7 Picton Picton 1 10/10/2022 0:00:… 11/10/2022 08:46:00         147.       -43.3
#> 8 Picton Picton 2 10/10/2022 10:14… 11/10/2022 10:29:00         147.       -43.2
#> # ℹ 8 more variables: longitude_dms <chr>, latitude_dms <chr>,
#> #   longitude_ddm <chr>, latitude_ddm <chr>, gps_uncertainty <dbl>,
#> #   species <chr>, count <dbl>, coordinatePrecision <dbl>