% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tbl.R
\name{tiff_crs}
\alias{tiff_crs}
\title{Read CRS metadata from a GeoTIFF}
\usage{
tiff_crs(path)
}
\arguments{
\item{path}{Path to a GeoTIFF file.}
}
\value{
A list with elements \code{epsg} (integer or \code{NA_integer_}) and
\code{citation} (character or \code{NA_character_}).
}
\description{
Returns the spatial reference system embedded in a GeoTIFF, parsed from
the GeoKey directory (TIFF tag 34735). The projected CRS EPSG
(\code{PCSTypeGeoKey} 3072) is preferred over the geographic CRS EPSG
(\code{GeographicTypeGeoKey} 2048). Citation strings are read from
\code{GeoAsciiParams} (tag 34737) with priority PCS > GeoTIFF > geographic.
}
\details{
Files written without a GeoKey directory return \code{NA} for both fields.
}
\examples{
\donttest{
f <- tempfile(fileext = ".tif")
df <- data.frame(x = 1:4, y = rep(1:2, each = 2), band1 = as.double(1:4))
write_tiff(df, f)
tiff_crs(f)  # epsg = NA, citation = NA — vectra writer omits GeoKeys
unlink(f)
}

}
