[R-sig-Geo] Reading National Snow and Ice Data Center binary files
Anthony Fischbach
afischbach at usgs.gov
Wed Oct 19 20:03:31 CEST 2011
Thank you for the GRASS suggestion.
It would also be straight forward in ArgGIS, but I seek to run this all in a
scripting environment with the full flexibility of R such that I may
automate the whole process.
Following on the projectRaster idea, I have tried using the from and to
options, first creating a from raster corresponding to the geographic extent
and resolution of the desired output raster.
> ll_lt <- 30.98
> ll_ln <- 168.35
> ur_lt <- 33.92
> ur_ln <- 279.26
> rGeo <- raster(nrows=448, ncols=304, xmn=ll_ln, xmx=ur_ln, ymn=ll_lt,
> ymx=ur_lt, crs="+proj=longlat +datum=WGS84")
> ## look at the raster before projecting
> rr
class : RasterLayer
dimensions : 448, 304, 136192 (nrow, ncol, ncell)
resolution : 25000, 25000 (x, y)
extent : -3837500, 3762500, -5362500, 5837500 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0
+a=6378273 +b=6356889.449 +units=m +no_defs
values : ...\SeaIce\NSIDC\NearRealTime\nt_20111011.tif
min value : 0
max value : 1
> ## Project
> rgeo <- projectRaster(from=rr, to=rGeo, method= 'bilinear')
> rgeo
class : RasterLayer
dimensions : 448, 304, 136192 (nrow, ncol, ncell)
resolution : 0.3648355, 0.0065625 (x, y)
extent : 168.35, 279.26, 30.98, 33.92 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
values : in memory
min value : 0
max value : 0
It fails to populate with the data.
-----
Tony Fischbach, Wildlife Biologist
Walrus Research Program
Alaska Science Center
U.S. Geological Survey
4210 University Drive
Anchorage, AK 99508-4650
AFischbach at usgs.gov
http://alaska.usgs.gov/science/biology/walrus
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Reading-National-Snow-and-Ice-Data-Center-binary-files-tp6882737p6909785.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
More information about the R-sig-Geo
mailing list