% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/regions.R
\name{a5_linestring_to_cells}
\alias{a5_linestring_to_cells}
\title{Cells traced by a great-circle linestring}
\usage{
a5_linestring_to_cells(x, resolution)
}
\arguments{
\item{x}{A linestring-like geometry. One of:
\itemize{
\item Any geometry handleable by \code{\link[wk:wk_handle]{wk::wk_handle()}} containing one or
more \code{LINESTRING} / \code{MULTILINESTRING} features.
\item A \code{SpatVector} of linestrings (requires the \code{terra} package).
\item A two-column numeric matrix (\code{cbind(lon, lat)}) of waypoints.
\item A \code{data.frame} with columns \code{lon} and \code{lat}.
}}

\item{resolution}{Integer scalar target resolution (0--30).}
}
\value{
An \link{a5_cell} vector at \code{resolution}.
}
\description{
Returns the A5 cells at \code{resolution} whose pentagons are intersected by
the great-circle polyline connecting the supplied waypoints. Output is
uncompacted, in discovery order along the path, with duplicates removed
first-seen. Multi-feature inputs (a \code{MULTILINESTRING} or an \code{sfc} of
multiple linestrings) are handled natively: per-feature cell sequences
are concatenated in feature order with first-seen deduplication.
}
\details{
Consecutive waypoints are connected by great-circle arcs (not rhumb
lines or planar segments), so antimeridian-crossing paths work
transparently when written in unwrapped lon/lat.

Matrix and \code{data.frame} inputs are treated as a single linestring;
for multi-feature data, pass an \code{sf}, \code{sfc}, wk, or \code{SpatVector}
geometry instead.
}
\examples{
line <- wk::wkt("LINESTRING (2.35 48.86, -0.13 51.51)")
cells <- a5_linestring_to_cells(line, resolution = 6)
length(cells)
}
\seealso{
\code{\link[=a5_polygon_to_cells]{a5_polygon_to_cells()}}, \code{\link[=a5_grid_disk]{a5_grid_disk()}}.
}
