lonlatreproject: Reproject WGS 84 longitude and latitude into a new raster...

View source: R/biomass.R

lonlatreprojectR Documentation

Reproject WGS 84 longitude and latitude into a new raster coordinates and vice versa

Description

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

x

a longitude or raster or vector object

y

a latitude or raster or vector object

var

numeric variable. The length should be same as the length of latitude and longitude

map

Raster* object that will be used to define the new coordinates.

epsg

coordinate reference number. The default is WGS 84: 4326

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.

Value

New x, y and map

Author(s)

George Owusu

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,ext=temp)
longitude=newlonlat$longitude
map=newlonlat$map



gowusu/sebkc documentation built on July 28, 2023, 11:44 a.m.