R/geochull.R

Defines functions geochull

Documented in geochull

geochull <-
function(lat, lon = NULL)
{
	if(is.null(lon)) {
		lon <- lat$lon
		lat <- lat$lat
	}
	x <- Proj(lat, lon)$x
	y <- Proj(lat, lon)$y
	id <- chull(x, y)
	id <- c(id, id[1])
	data.frame(invProj(x[id], y[id])[c("lat", "lon")])
}

Try the geo package in your browser

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

geo documentation built on May 2, 2019, 5:22 p.m.