[R-sig-Geo] plotKML 'kml' function with raster input

2015-10-12 Thread Gregovich, Dave P (DFG)
Hello, I am not able to create a .kml raster via the 'kml' function of plotKML (see the error below). I am setting the path to gdal in my windows registry as 'C:/Program Files/GDAL' -- the folder that contains 'gdalwarp.exe' and 'gdal_translate.exe' upon gdal installation. I have also set the

Re: [R-sig-Geo] plotKML 'kml' function with raster input

2015-10-13 Thread Gregovich, Dave P (DFG)
' rast <- raster(extent(-135.2,-135.1,58.1,58.2),nrows=10,ncol=10,crs=CRS('+init=epsg:4326')) rast[]<-rnorm(ncell(rast)) kml(rast,kml.fold,kml.file,colour = 'black') #______ Dave. -----Original Message- From: Paul Woods [mailto:p.wo...@

Re: [R-sig-Geo] plotKML 'kml' function with raster input

2015-10-14 Thread Gregovich, Dave P (DFG)
; should be gdalt <- "C:/Program Files/GDAL/gdal_translate.exe" Dave. -Original Message- From: Frede Aakmann Tøgersen [mailto:fr...@vestas.com] Sent: Tuesday, October 13, 2015 9:59 PM To: Vijay Lulla; Gregovich, Dave P (DFG) Cc: r-sig-geo@r-project.org Subject: RE: [R-sig-Geo

[R-sig-Geo] Raster math on a stack of large rasters

2017-04-06 Thread Gregovich, Dave P (DFG)
Hi, I am performing a math operation on a stack of large rasters. The code below uses smaller files for illustration and reproducibility. Any alternative way of performing this task that does not create huge temporary files, and perhaps cuts down on processing time, would be greatly appreciated.

Re: [R-sig-Geo] Raster math on a stack of large rasters

2017-04-06 Thread Gregovich, Dave P (DFG)
not attached): [1] rgdal_1.2-5 tools_3.3.3 Rcpp_0.12.9 grid_3.3.3 lattice_0.20-34 From: Gregovich, Dave P (DFG) Sent: Thursday, April 06, 2017 9:27 AM To: 'r-sig-geo@r-project.org' Subject: Raster math on a stack of large rasters Hi, I am performing a math operation

[R-sig-Geo] Adding rasters to a 'plotRGB' plot

2017-12-20 Thread Gregovich, Dave P (DFG)
Hello, I would like to add rasters to a plotRGB plot, but they don't seem to register correctly with the initial (=background) raster plotted, as illustrated with the following code. Does anybody out there know of a way to ensure that additional overlain rasters register spatially with the initi

[R-sig-Geo] Distance from not NA cells in a raster

2018-07-06 Thread Gregovich, Dave P (DFG)
Hi, I would like to obtain the distance from all not NA cells in a raster. This works for smaller rasters, but seems difficult for the size of rasters (~ 8000 pixel square) I am working with. Below is what I've tried. I would be OK calling other software from R, or using some parallelization, i

Re: [R-sig-Geo] Distance from not NA cells in a raster

2018-07-06 Thread Gregovich, Dave P (DFG)
0.7 foreign_0.8-69 gstat_1.1-6 rgdal_1.2-16 [7] raster_2.6-7 sp_1.2-5 From: Gregovich, Dave P (DFG) Sent: Friday, July 06, 2018 8:23 AM To: 'r-sig-geo@r-project.org' Subject: Distance from not NA cells in a raster Hi, I would like to obtain the distance from all not NA cells in a raster

[R-sig-Geo] +no_uoff flag in proj4string, epsg 26931

2014-08-12 Thread Gregovich, Dave P (DFG)
Hello, I would like to project data in epsg 26931 (NAD83 Alaska State Plane zone 1 meters), variant A. There are two variants to the projection: --variant A has its origin on the central line of the projection, on the 'aposphere equator' --variant B has its origin at the projection center Apparen

[R-sig-Geo] Error when predicting a randomForest model to a raster

2015-01-13 Thread Gregovich, Dave P (DFG)
Hello, Thanks kindly aforehand for any help you can lend. I am trying to perform a simple classification of coarse vegetation types. I am getting an error when trying to predict a randomForest model to a raster: #Error in if (any(is.na(x))) stop("missing values in newdata") : # argument is not i

[R-sig-Geo] Replacing values in large rasters using conditional statements

2015-02-25 Thread Gregovich, Dave P (DFG)
Hello, I often replace values in a raster based on values of another raster, like this: n.row <- n.col <- 100 a <-raster(nrows=n.row,ncols=n.col) b <- a a[]<-rnorm(ncell(a)) b[]<-rnorm(ncell(b)) a[b > 0] <- 1 What would analogous code be that works for large rasters without running into vector

Re: [R-sig-Geo] Replacing values in large rasters using conditional statements

2015-02-26 Thread Gregovich, Dave P (DFG)
Well, This may be somewhat remedial for some, but it is a voyage of discovery for me: It appears that using the 'overlay' function is the analogous method I was looking for. I am not absolutely positive it works for *very* large rasters. But it does seem to work with the 5 X 10^8-cell rasters I

[R-sig-Geo] alpha support in raster function 'KML'?

2015-04-07 Thread Gregovich, Dave P (DFG)
Hello, Does the 'KML' function from the raster package support an alpha channel? The .kml file output via the code below suggests it does not, but I was hoping for confirmation. Thanks kindly. Dave. #__ library(raster) r <- raster(nrows=108,

[R-sig-Geo] Setting raster x- and y-resolutions equal

2015-05-28 Thread Gregovich, Dave P (DFG)
Hello, I have a stack of about 40 rasters with about 1 X 10^7 cells in each. I did not realize it, but it turns out the x-resolution and y-resolution differ at about the 13th decimal point. And I would like to feed this stack into a function (dynatopmodel::upslope.area) that requires xres(x)==yr

[R-sig-Geo] gps file->WGS84->NAD83 Alaska stateplane zone 1

2012-07-05 Thread Gregovich, Dave P (DFG)
Hello, I am new to R-sig-geo, thanks for your patience. I am trying to bring GPS animal collar data into R and correctly project it to NAD83 Alaska Stateplane zone 1 (epsg:26931 should be the correct proj4 code). In leiu of any other way to verify if my projection is working, I am comparin

[R-sig-Geo] projectRaster causes R front end to crash

2012-10-02 Thread Gregovich, Dave P (DFG)
Hello, When I attempt to run this simple code example from the projectRaster() examples, my new R installation (R 2.15.1, raster package 2.0-08, and rgdal 0.7-15) crashes: r <- raster(xmn=-110, xmx=-90, ymn=40, ymx=60, ncols=40, nrows=40) r <- setValues(r, 1:ncell(r)) projection(r) newproj <- "+