Reproject WGS 84 longitude and latitude into a new raster coordinates and vice versa
Source:R/biomass.R
lonlatreproject.RdReproject 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)
#> Computing Radiance: this may take several minutes........
#> Computing Reflectance
#> Computing Albedo
#> Computing NDVI
#> Computing SAVI
#> Computing LAI
#> Computing emissivities
#> Computing corrected thermal radiance
#> Computing Surface temperature
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)
#> Warning: GDAL Message 1: +init=epsg:XXXX syntax is deprecated. It might return a CRS with a non-EPSG compliant axis order. Further messages of this type will be suppressed.
longitude=newlonlat$longitude
map=newlonlat$map