% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sp_transform.R
\name{sp_transform}
\alias{sp_transform}
\title{Convenience function to transform a spatial object's projection system to 
WGS84 latitude and longitude.}
\usage{
sp_transform(sp, to = NA, warn = TRUE)
}
\arguments{
\item{sp}{Spatial object which is to be transformed.}

\item{to}{A proj4 string for the projection-transformation. Default is the 
WGS84 string.}

\item{warn}{Should the functions raise a warning when the projection is forced?}
}
\description{
\code{sp_transform} is a simple wrapper for \code{spTransform} which has 
been written so spatial objects can be transformed quickly without the need 
to remember the WGS84 proj4 string. \code{sp_transform} will force projections
when the spatial object contains no projection information.
}
\details{
\code{sp_transform} will also work for raster layers.
}
\examples{
\dontrun{

# Load a shape file of canal locks for the UK
sp_locks <- sp_read("uk-canals", "locks")

# Print projection string
sp_projection(sp_locks)

# Convert the shape file's projection (UK's Ordnance Survey National Grid)
to WGS84 latitude and longitude
sp_locks <- sp_transform(sp_locks)

# Print projection string
sp_projection(sp_locks)

}

}
\seealso{
\code{\link{spTransform}}, \code{\link{sp_projection}}, 
\code{\link{projection_wgs84}}
}
\author{
Stuart K. Grange
}
