check_crs: Check coordinate reference systems match

View source: R/utils.R

check_crsR Documentation

Check coordinate reference systems match

Description

This function checks that coordinate reference systems (CRS) match.

Usage

check_crs(...)

Arguments

...

Objects of CRS-class or from which CRS-class object(s) can be extracted (via crs).

Details

The first (‘baseline’) CRS is compared against that for every other input. NULL inputs are ignored. For any mismatches, an instructive warning is returned alongside the details of each mismatch.

Author(s)

Edward Lavender

Examples

## Not run: 
# The function can accept spatial objects
check_crs(dat_gebco, dat_coast)
check_crs(
  dat_gebco,
  dat_coast,
  raster::raster(matrix(1))
)

# The function can accept CRS objects
check_crs(dat_gebco, sp::CRS(as.character(NA)))

# The function can accept NULL elements
check_crs(dat_gebco, NULL)

## End(Not run)


edwardlavender/flapper documentation built on Jan. 22, 2025, 2:44 p.m.