expect_crs: Expect coordinate reference systems

Description Usage Arguments Examples

View source: R/expect_crs.R

Description

Expect coordinate reference systems

Usage

1
expect_crs(object, epsg = NULL, proj4string = NULL)

Arguments

object

object of class sf or sfc

epsg

A character for EPSG codes

proj4string

A character string of projection arguments

Examples

1
2
3
4
5
6
sfc <- sf::st_sfc(sf::st_point(c(0, 0)),
sf::st_point(c(1, 1)))
sf <- sf::st_sf(a = 1:2, geom = sfc)
sf::st_crs(sf) <- 4326
expect_crs(sf, 4326)
expect_crs(sf, proj4string = "+proj=longlat +datum=WGS84 +no_defs")

uribo/tst documentation built on April 6, 2020, 11:58 p.m.