intermediate: Intermediate points on a great circle (sphere)

Description Usage Arguments Value Author(s) References Examples

Description

Get intermediate points (way points) between the two locations with longitude/latitude coordinates. gcIntermediate is based on a spherical model of the earth and internally uses distCosine.

Usage

1
gcIntermediate(p1, p2, n=50, breakAtDateLine=FALSE, addStartEnd=FALSE, sp=FALSE, sepNA) 

Arguments

p1

longitude/latitude of a single point, in degrees. This can be a vector of two numbers, a matrix of 2 columns (first one is longitude, second is latitude) or a SpatialPoints* object

p2

as for p1

n

integer. The desired number of intermediate points

breakAtDateLine

logical. Return two matrices if the dateline is crossed?

addStartEnd

logical. Add p1 and p2 to the result?

sp

logical. Return a SpatialLines object?

sepNA

logical. Rather than as a list, return the values as a two column matrix with lines seperated by a row of NA values? (for use in 'plot')

Value

matrix or list with intermediate points

Author(s)

Robert Hijmans based on code by Ed Williams (great circle)

References

http://www.edwilliams.org/avform.htm#Intermediate

Examples

1
gcIntermediate(c(5,52), c(-120,37), n=6, addStartEnd=TRUE)

Example output

Loading required package: sp
             lon      lat
[1,]    5.000000 52.00000
[2,]   -9.924971 59.60085
[3,]  -31.666402 64.65469
[4,]  -58.557896 65.51770
[5,]  -82.746574 61.80095
[6,]  -99.938739 54.93700
[7,] -111.623334 46.39746
[8,] -120.000000 37.00000

geosphere documentation built on May 2, 2019, 5:16 p.m.