% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spatial_sf.R
\name{build_neighbor_structure}
\alias{build_neighbor_structure}
\title{Build a neighbour structure from an sf object}
\usage{
build_neighbor_structure(spatial, type = c("distance", "contiguity"))
}
\arguments{
\item{spatial}{An `sf` object.}

\item{type}{Character scalar: `"distance"` (default) or `"contiguity"`.}
}
\value{
* For `"distance"`: a numeric matrix with columns `X` and `Y`.
* For `"contiguity"`: a named list of integer vectors.
}
\description{
Returns different structures depending on `type`:
}
\details{
* `"distance"` — a numeric coordinate matrix (columns `X` and `Y`) suitable
  for pairwise distance computation.
* `"contiguity"` — a named list where each element is the integer vector of
  neighbour row indices (1-based, Queen contiguity via
  `sf::st_relate()`). Used for spatial diagnostics such as Moran's I.
}
\keyword{internal}
