% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/interpolation_legacy.R
\name{interpolate_distance_surface}
\alias{interpolate_distance_surface}
\title{Interpolate a distance surface from least-cost distance points}
\usage{
interpolate_distance_surface(
  distance_points,
  region_area,
  study_area,
  resolution_coarse = 100,
  resolution_fine = 1,
  distance_col = "distance"
)
}
\arguments{
\item{distance_points}{Point layer with a distance column.}

\item{region_area}{Broader analysis region used for interpolation extent.}

\item{study_area}{Final study area used to crop and mask the output.}

\item{resolution_coarse}{Coarse interpolation resolution.}

\item{resolution_fine}{Fine output resolution.}

\item{distance_col}{Name of distance column in \code{distance_points}.}
}
\value{
A \code{SpatRaster} distance surface.
}
\description{
Uses thin-plate spline interpolation to create a continuous distance surface.
This preserves the original paper-script approach while keeping interpolation
optional. For most package workflows, \code{make_evac_polygons()} is the simpler
output.
}
\examples{
if (requireNamespace("fields", quietly = TRUE)) {
  pts <- terra::vect(
    data.frame(
      x = c(0, 1, 0, 1, 0.5, 1.5),
      y = c(0, 0, 1, 1, 0.5, 1.5),
      distance = c(0, 5, 10, 15, 7, 20)
    ),
    geom = c("x", "y"),
    crs = "EPSG:3857"
  )
  area <- terra::as.polygons(terra::rast(nrows = 2, ncols = 2, xmin = -1, xmax = 2,
    ymin = -1, ymax = 2, vals = 1, crs = "EPSG:3857"), dissolve = TRUE)
  interpolate_distance_surface(pts, area, area, resolution_coarse = 0.5, resolution_fine = 1)
}
}
