Learn R Programming

geocausal (version 0.4.0)

get_dist_focus: Get distance maps

Description

`get_dist_focus()` generates a distance map from focus locations.

Usage

get_dist_focus(
  window,
  lon,
  lat,
  resolution = NULL,
  ndim = NULL,
  mile = FALSE,
  preprocess = FALSE,
  input_crs = 4326,
  unit_scale = 1000
)

Value

an im object

Arguments

window

owin object

lon

vector of longitudes

lat

vector of latitudes

resolution

resolution of raster (distance map) (in km; by default, 1). Ignored if npixel is set.

ndim

number of pixels for both dimensions (e.g., 256 for 256x256). If set, resolution is ignored.

mile

logical. `mile` specifies whether to return the output in miles instead of kilometers (by default, FALSE).

preprocess

logical. `preprocess` specifies whether to first pick the potentially closest point. It is recommended to set `preprocess = TRUE` if users need to obtain distances from many points.

input_crs

the CRS of the focus points (defaults to 4326). These points are internally projected to match the window CRS to ensure isotropic distance calculations.

unit_scale

set to the same value as the parameter in `get_window()` function. This parameter converts the coordinate values so that they alingn with the unit (km) of the owin object