point_offset: Identify new location based on distance and bearing from...

View source: R/util-point_offset.r

point_offsetR Documentation

Identify new location based on distance and bearing from another

Description

Calculates latitude and longitude for new point that is x meters away at bearing y from a geographic location (Longitude, Latitude). uses "destPoint" function from "geosphere" package and calculations are based on great circle distances.

Usage

point_offset(lon = NA, lat = NA, offsetDist = NA, offsetDir = NA,
  distUnit = "m")

Arguments

lon

vector of longitudes (dd) to calculate offset points

lat

vector of latitudes (dd) to calculate offset points

offsetDist

vector of distances to calculate offset point (meters or feet)

offsetDir

vector of directions to calculate point from starting point. Options are NA,"N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"

distUnit

specify meters or ft ("m" or "ft")

Examples

lat <- rep(44.0, 17)
lon <- rep(-83.0, 17)

offsetDir <- c(NA,"N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S",
"SSW", "SW", "WSW", "W", "WNW", "NW", "NNW") 

offsetDist <- seq(100, 1700, by = 100) 
distUnit <- 'm'

point_offset(lon, lat, offsetDist, offsetDir, distUnit)


jsta/glatos documentation built on July 11, 2022, 7:01 a.m.