`get_dist_line()` generates a distance map from lines and polygons.
get_dist_line(
window,
path_to_shapefile = NULL,
line_data = NULL,
mile = FALSE,
resolution = NULL,
ndim = NULL,
preprocess = TRUE,
unit_scale = 1000
)an im object
owin object
path to shapefile
sfc_MULTILINESTRING file (If available. If not, `get_dist_line()` creates it from a shapefile.)
logical. `mile` specifies whether to return the output in miles instead of kilometers (by default, FALSE).
resolution of raster objects (distance map) (in km; by default, 1). Ignored if ndim is set.
number of pixels for both dimensions (e.g., 256 for 256x256). If set, resolution is ignored.
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.
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
The function ensures spatial integrity by automatically projecting the
line_data or shapefile to match the Coordinate Reference System (CRS)
of the window.