[R-sig-Geo] projectRaster() produces an object with no values

rr2box42 rr2box42 at gmail.com
Wed Oct 3 23:15:08 CEST 2012


I am having the same problem as the OP. I understand Robert's response, but I
don't think it applies to my situation. Any ideas?

Here are my rasters:
    > from.rast
    class       : RasterLayer 
    band        : 2 
    dimensions  : 96, 192, 18432  (nrow, ncol, ncell)
    resolution  : 1.875, 1.864677  (x, y)
    extent      : -0.9375, 359.0625, -89.50451, 89.50451  (xmin, xmax, ymin,
ymax)
    coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 
    data source :
/Volumes/Gonzo/mpi_sd/cmip5/mpi_esm_p/past1000/tas_Amon_MPI-ESM-P_past1000_r1i1p1_085001-184912.nc 
    names       : Near.Surface.Air.Temperature 
    z-value     : 0850-02-15 
    zvar        : tas 
    
    > to.rast
    class       : RasterLayer 
    dimensions  : 100, 100, 10000  (nrow, ncol, ncell)
    resolution  : 1000, 1000  (x, y)
    extent      : -56204.44, 43795.56, 1590440, 1690440  (xmin, xmax, ymin,
ymax)
    coord. ref. : +proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0
+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs +towgs84=0,0,0 
    data source : in memory
    names       : X1kmt_1860_6 
    values      : 8.016666, 15.00667  (min, max)


And here's how I'm trying to project them, along with the result:

    > proj.rast = projectRaster(from=from.rast, to=to.rast)
    > 
    > proj.rast
    class       : RasterLayer 
    dimensions  : 100, 100, 10000  (nrow, ncol, ncell)
    resolution  : 1000, 1000  (x, y)
    extent      : -56204.44, 43795.56, 1590440, 1690440  (xmin, xmax, ymin,
ymax)
    coord. ref. : +proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0
+y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs +towgs84=0,0,0 
    data source : in memory
    names       : Near.Surface.Air.Temperature 
    values      : NA, NA  (min, max)



I note that printing my 'from.rast' gives no 'values' field like my
'to.rast' has. The former came from a netCDF file, the latter from a geotiff
[both input with 'raster()']. I can confirm that 'from.rast' really does
have the values in there though:

    > summary(from.rast)
                 
    Min.    223.8
    1st Qu. 258.0
    Median  280.8
    Mean    275.7
    3rd Qu. 295.4
    Max.    305.3


And now I'm stumped. Thanks for the help in advance...

Bagel




--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/projectRaster-produces-an-object-with-no-values-tp7580263p7581107.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list