R/utils.R

Defines functions ok_lon_lat.matrix ok_lon_lat.numeric ok_lon_lat

ok_lon_lat <- function(x, ...) UseMethod("ok_lon_lat")
ok_lon_lat.numeric <- function(x, ...) {
  x[1] > -365 && 
    x[2] < 365 &&
    x[3] > -91 && x[4] < 91
}

ok_lon_lat.matrix <- function(x, ...) {
  ok_lon_lat(c(range(x[, 1L], na.rm = TRUE), range(x[, 2L], na.rm = TRUE)))
}

Try the reproj package in your browser

Any scripts or data that you put into this service are public.

reproj documentation built on Oct. 29, 2022, 1:09 a.m.