% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/biomass.R
\name{lonlatreproject}
\alias{lonlatreproject}
\title{Reproject WGS 84 longitude and latitude  into a new raster coordinates and vice versa}
\usage{
lonlatreproject(x, y = NULL, var = NA, map, epsg = 4326)
}
\arguments{
\item{x}{a longitude or raster or vector object}

\item{y}{a latitude or raster or vector object}

\item{var}{numeric variable. The length should be same as the length of 
latitude and longitude}

\item{map}{Raster* object that will be used to define the new coordinates.}

\item{epsg}{coordinate reference number. The default is WGS 84: 4326}
}
\value{
New x, y and map
}
\description{
Reproject WGS 84 longitude and latitude  into a new raster coordinates and vice versa
}
\details{
If x is a list of longitudes then new  horizontal  coordinates based on map
coordinates. If x is a raster object with  horizontal  coordinates then it will be projected to
WGS 84.
}
\examples{
folder=system.file("extdata","stack",package="sebkc")
data=landsat578(data=folder, welev=362)
temp=data$Ts
latitude=seq(7.544,7.590,0.001)
longitude=seq(-1.211,-1.187,0.001)
var=seq(20,30,0.2)
latitude=latitude[1:length(longitude)]
var=var[1:length(longitude)]
newlonlat=lonlatreproject(longitude,latitude,var=var,map=temp)
longitude=newlonlat$longitude
map=newlonlat$map


}
\author{
George Owusu
}
