Hi all,

I have created a raster brick and the data is in lat/long coordinate
system. I would like to re-project the brick to UTM and then save the data.
The output of my code gives me NA and -Inf for the values of the
re-projected raster brick:

install.packages("rgdal")
install.packages("raster")
install.packages("sp")
library(rgdal)
library(raster)
library(sp)

f <- "K:/PRISM_US800m_2010edition/ppt_east_prism.nc"
b <- brick(f,lvar=4)
NAvalue(b) <- -1e+34

b

class       : RasterBrick
dimensions  : 121, 121, 14641, 348  (nrow, ncol, ncell, nlayers)
resolution  : 0.008333, 0.008333  (x, y)
extent      : 237.9958, 239.0041, 43.99583, 45.00413  (xmin, xmax, ymin,
ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
data source : K:\PRISM_US800m_2010edition\ppt_east_prism.nc
names       : X1981.04162597656, X1981.125, X1981.20837402344,
X1981.29174804688, X1981.375, X1981.45837402344, X1981.54174804688,
X1981.625, X1981.70837402344, X1981.79174804688, X1981.875,
X1981.95837402344, X1982.04174804688, X1982.125, X1982.20837402344, ...
year        : 1981.04162597656, 2009.95837402344 (min, max)
varname     : PPT_EAST

utmproj <- "+proj=utm +zone=10 +ellps=GRS80 +units=m +no_defs"
bnew <-
projectRaster(b,res=800,crs=utmproj,method="bilinear",alignOnly=FALSE,over=FALSE)

 bnew
class       : RasterBrick
dimensions  : 152, 113, 17176, 348  (nrow, ncol, ncell, nlayers)
resolution  : 800, 800  (x, y)
extent      : 574481.3, 664881.3, 4867763, 4989363  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=utm +zone=10 +ellps=GRS80 +units=m +no_defs
data source : in memory
names       : X1981.04162597656, X1981.125, X1981.20837402344,
X1981.29174804688, X1981.375, X1981.45837402344, X1981.54174804688,
X1981.625, X1981.70837402344, X1981.79174804688, X1981.875,
X1981.95837402344, X1982.04174804688, X1982.125, X1982.20837402344, ...
min values  :                NA,        NA,                NA,
   NA,        NA,                NA,                NA,        NA,
       NA,                NA,        NA,                NA,
 NA,        NA,                NA, ...
max values  :                 ?,         ?,                 ?,
    ?,         ?,                 ?,                 ?,         ?,
        ?,                 ?,         ?,                 ?,
?,         ?,                 ?, ...

Any ideas? Thank you.

Matt

-- 
*Matt Cooper*
Water Resources Graduate Program
College of Earth, Ocean and Atmospheric Sciences
Oregon State University

(831) 566 9149
matthew.cooper@geo.oregonstate.edu

	[[alternative HTML version deleted]]

