[R-sig-Geo] projectRaster error with netcdf

Tom Hilinski tom.hilinski at colostate.edu
Fri May 13 15:53:30 CEST 2011


Having an error in getting library raster to read data from a netcdf
file when reprojecting a raster.
I'd appreciate any workarounds you can suggest.
Here's the debug transcript:

-----
debug at NARR.R#142: r <- projectRaster(r, "+proj=longlat +ellps=WGS84
+datum=WGS84 +no_defs")

Browse[2]> r
class       : RasterLayer
band        : 1
dimensions  : 277, 349, 96673  (nrow, ncol, ncell)
resolution  : 0.8428132, 0.1651133  (x, y)
extent      : -145.5, 148.6418, 0.897945, 46.63433  (xmin, xmax, ymin, ymax)
projection  : +proj=lcc +lat_1=50.0 +lat_2=50.0 +lon_0=-107.0
+lat_0=50.0 +x_0=5632642.22547 +y_0=4612545.65137 +ellps=WGS84
+datum=WGS84 +units=m +no_defs +towgs84=0,0,0
values      : <snip>/soilm.mon.mean.nc
min         : ?
max         : ?

Browse[2]> file.exists( r at file@name )
[1] TRUE

Browse[2]> n
Error in .rasterObjectFromFile(x, band = band, objecttype =
"RasterLayer",  :
  Cannot create a RasterLayer object from this file. (file does not exist)
-----

library versions:
raster_1.8-12 rgdal_0.6-33  sp_0.9-81     ncdf_1.6.5



More information about the R-sig-Geo mailing list