Questions tagged [raster]

A rectangular array of pixels. A Raster defines values for pixels occupying a particular rectangular area of the plane, not necessarily including (0, 0).

A rectangular array of pixels. A Raster defines values for pixels occupying a particular rectangular area of the plane, not necessarily including (0, 0).

3658 questions
1
vote
2 answers

Mean of RasterLayer will Not Compute (R Raster Package)

So, I have stacked multiple rasters (x1, x2, x3, x4, ...) and successfully computed a mean raster from all of those (xmaster). However, I then want the mean pixel value of that raster (xmaster). Normally I would display the summary statistics and…
Alexander
  • 59
  • 1
  • 8
1
vote
1 answer

Plotting the maximum of a raster stack in R with specific colours

I have a raster stack of 5 rasters (invented examples here in s), and I would like to make two plots of the max and min value from this stack- this is fairly simple using max/ min (a). r <- raster(nrows=10,ncols=100) r[] <- rnorm(1000) s <-…
Arferion
  • 53
  • 4
1
vote
3 answers

Calculate selected area from stacked raster object

As I have only recently started using R for spatial analysis, and I am not a geographer or spatial data specialist by any means, I have a -what I presume to be- relatively simple question. I am trying to calculate the area of part of a stacked…
1
vote
1 answer

Error using calc() function: cannot use this function

I need to run calculations on large multi-band rasters and export a RasterBrick, and am trying to do so using the calc() function in the raster package, for the purpose of memory efficiency. The function runs fine on its own, but when I try to…
Danple
  • 111
  • 2
  • 6
1
vote
1 answer

Extracting 'name-values' from raster instead of the 'ID levels' assigned by R

I have the following raster in R: > veg class : RasterLayer dimensions : 22142, 18123, 401279466 (nrow, ncol, ncell) resolution : 28.5, 28.5 (x, y) extent : 329232, 845737.5, 8487420, 9118467 (xmin, xmax, ymin, ymax) coord. ref. :…
TWest
  • 765
  • 2
  • 6
  • 27
1
vote
1 answer

Opening an ASCII file using R

I am trying to open an ASCII file in R.This file is exported from a software of thermal camera. It has temperature values of crop. I am using following code: library(raster) r = raster("AA092800_1.asc") plot(r) but every time i am getting…
Gopal Krishna
  • 55
  • 1
  • 2
  • 9
1
vote
1 answer

moving-window raster flood fill in R

Suppose I have a raster with integer values describing the timing of an event as day of year (DOY). If there was no event in the respective year, cells are set to NA. The clump() function of the R 'raster' package would allow to detect adjacent…
1
vote
2 answers

Rasterize polygons in R using snowfall & sfLapply

I would like to rasterize a very large vector file to 25m and have had some success with the 'cluster' package, adapting the qu's here and here, which worked nicely for that particular data. However I now have a larger vector file that needs…
Sam
  • 1,400
  • 13
  • 29
1
vote
0 answers

NetCDF to matrix and then to raster

I have extracted information from a large NetCDF file but have problems converting it into raster. In short I can plot the matrix fine with levelplot, however when I try to convert it into raster and plot it, the results look totally wrong and…
MIH
  • 1,083
  • 3
  • 14
  • 26
1
vote
1 answer

Error in assigning values to raster in R

I'm trying to follow the code to construct a residual autocovariate model described here: https://github.com/jejoenje/PubsRexamples/blob/master/Crase_etal.R#L16 After creating a large raster space I get an error when assigning values to the raster.…
Jock
  • 75
  • 1
  • 9
1
vote
1 answer

R focal (raster)- conditional filter (only run if window center is value 1)

I'd like to filter a large raster, but only run the filter if the center cell of the window is a specific value. Essentially I'd like to remove some speckle (false positives) from an image (pixels of 0 or 1), but only run the filter if window…
ThrushJacket
  • 145
  • 9
1
vote
1 answer

Interpolating large raster series in R

I have 36ish years of gridded/raster monthly temperature estimates that I'd like to convert into daily estimates. For now, I'm setting the monthly estimates at the midpoint of the month and doing a simple linear interpolation. To do so, I'm…
1
vote
1 answer

R understanding raster's corLocal neighborhood size parameter

I am calculating the Pearson correlation between two rasters (identical in dimensions and cell size) in a moving window with the corLocal from the raster package. It is not clear (to me) from the manual what the neighborhood size parameter (ngb)…
Ilik
  • 165
  • 10
1
vote
0 answers

Creating merged rasters in R

I'm trying to merge bunch of rasters I created to represent a lettuce farm. I don't want to go into detail, but I needed to create an individual raster for each produce bed and furrow (the area between two produce beds). So, my farm has 60 produce…
Amir M.
  • 71
  • 7
1
vote
1 answer

DistanceFromPoints with multiple XY coordinates

I'm trying to use distanceFromPoints function in raster package as: distanceFromPoints(object,xy,...) Where, object is raster and xy is matrix of x and y coordinates Now, if my raster has, for example, 1000 cells and xy represents one point, I get…
Amir M.
  • 71
  • 7