dtDestination: dt destination

Description Usage Arguments Value Examples

Description

Calculates the destination coordinates from a starting point, initial bearing and distance travelling along a (shortest distance) great circle arc

Usage

1
dtDestination(latFrom, lonFrom, distance, bearing)

Arguments

latFrom

latitude from (in degrees)

lonFrom

longitude from (in degrees)

distance

distance in metres

bearing

from north (in degrees)

Value

list of latitude and longitude coordinates at the destination

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
dtDestination(0, 0, earthsRadius(), 90)

n <- 10
set.seed(20170511)
lats <- -90:90
lons <- -180:180
b <- 0:360
dt <- data.table::data.table(lat = sample(lats, size = n, replace = T),
                             lon = sample(lons, size = n, replace = T),
                             bearing = sample(b, size = n, replace = T))
dt[, c("destinationLat", "destinationLon") := dtDestination(lat, lon, 90)]

SymbolixAU/spatialdatatable documentation built on May 6, 2019, 11:20 a.m.