create_matrix: Create a Distance Matrix Between Two Spatial Objects
Description
This function creates a distance matrix between two
spatial objects.
Usage
create_matrix(x, y, checksize = TRUE, longlat = TRUE)
Arguments
x
an sf object (POINT), rows of the distance matrix, row names are
used as
row names of the matrix.
y
an sf object (POINT), columns of the distance matrix, row names
are used
as column names of the matrix.
checksize
if FALSE, bypass the distance matrix size control
(see Details).
longlat
if FALSE, the Euclidean distance is used, if TRUE Great Circle
(WGS84 ellipsoid) distance is used.
Value
A distance matrix, row names are x row names, column
names are y row names.
Details
The function returns a full matrix of distances in meters.
If the matrix to compute is too large (more than 100,000,000 cells, more than
10,000,000 origins or more than 10,000,000 destinations)
the function may sends a message to warn users about the amount of
RAM mobilized.