calculate_distance: calculate distance between adjacent cells

View source: R/calculate_distance.R

calculate_distanceR Documentation

calculate distance between adjacent cells

Description

calculate distance between adjacent cells

Usage

calculate_distance(x, adj)

Arguments

x

spatRaster

adj

matrix of adjacent cells

Details

calculate_distance function allows for both projected and geographic coordinate systems. If the coordinate system is geographic (e.g. wgs84) the distance is calculated using the sf::st_distance function else distance calculated using Pythagorean theorem

Value

matrix euclidean distances between adjacent cells

Author(s)

Joseph Lewis


josephlewis/leastcostpath documentation built on Oct. 18, 2023, 2:03 p.m.