Questions tagged [r-raster]

raster is an R package for geographic data analysis and modeling.

Other resources

Related tags

1217 questions
0
votes
0 answers

extraction function gives a warning message and no data in r

I want to do an extration from rasterdata and add the information to the polygon, but I get this warning and the extration contains only null values Warning message: In .local(x, y, ...) : cannot return a sp object because the data length varies…
EteB
  • 13
  • 7
0
votes
1 answer

Use case of setValues raster

I recently stumbled upon the setValues()form the raster package, but I am wondering what the use case of this function is. Is there any advantage compared to normal subsetting and indexing: r <- raster(ncol=10, nrow=10) #setValues Function r …
maRtin
  • 6,336
  • 11
  • 43
  • 66
0
votes
1 answer

How to calculate multiple bands at the same time R raster?

I am trying to calculate a 72 bands raster. If the first 36 bands value (near infrared band) is greater than the latter 36 bands value (shortwave infrared band), assign it 0; if not then proceed on the following function. I tried other ways of…
Yuyun He
  • 5
  • 1
  • 3
0
votes
0 answers

How can I apply function using stackApply or Calc, in rasterEngine, and save the results as raster object in R? # edited

I have been working in a list of function to process MODIS vegetation index timeseries and return crop cycle paramenters. It's for PhD thesis and I'll process all South America, so I need to use all forms to reduce the time to process. I found the…
0
votes
0 answers

Show progress of spatial vector data in R

I am searching for a method to show progress when doing spatial operations in R. I know there are some for working with raster-data. Does anyone know a way to show progress when doing an operation with vactor-data like union{raster}? It would really…
Chitou
  • 81
  • 1
  • 6
0
votes
2 answers

Use SVM predict raster file in R

I am new to R. And I already have a SVM model in R. Right now, I have two raster image, one is the elevation, another one is the slope. The elevation and slope would be used as the predictors for SVM. And I also want to plot the results as a…
DU XINWEI
  • 1
  • 1
0
votes
1 answer

What does raster$fun do?

I am trying to use the code referenced in this post but I can't figure out why it is necessary to run raster.list$fun = mean. (See answers in link) Can anyone tell me what this does?
userfriendly
  • 363
  • 1
  • 4
  • 12
0
votes
1 answer

Add SpatialPointsDataFrame and SpatialLinesDataFrame to raster plot

I need to convert a shape file into a raster and have absolutely no clue where to even start. If anyone could help me out I'd really appreciate! Update: I have found out about the 'readOGR'-function, but everytime I use it I get the following…
snoops
  • 37
  • 7
0
votes
1 answer

Get slope between two cells in gdistance

I have created the following Transition Object from a raster containing altitude values of a landscape in R: wd <- "C:/Users/LG/Dropbox/Random Walk" setwd(wd) …
snoops
  • 37
  • 7
0
votes
1 answer

Get sequence of adjacent cell numbers out of a raster

I am currently working on a script, that loads a TIF file into a raster object, crops it and plots two points (starting point and point of destination; selected via the click-function) into that raster. I then want it to get the cell numbers of…
snoops
  • 37
  • 7
0
votes
0 answers

Plot lines into a raster in R

I have been onto this all day but haven't found a satisfying solution yet. I plotted a raster and created a matrix (="coord_mat"; left column contains X-coordinates, right column the Y-coordinates) that contains the coordinates of multiple points…
snoops
  • 37
  • 7
0
votes
1 answer

NSIDC sea ice .bin file to raster()

I am trying to follow the example give here under "A polar example" This example uses sea-ice data in .bin format to plot as raster. I am trying the same with a different file available from the original ftp server of the National Snow and Ice Data…
Larusson
  • 267
  • 3
  • 21
0
votes
1 answer

Is it possible to import a raster of a PDF file?

Our office does scanning of data entry forms, and we lack any proprietary software that is able to do automated double-entry (primary entry is done by hand, of course). We are hoping to provide a tool for researchers to highlight regions on forms…
AdamO
  • 4,283
  • 1
  • 27
  • 39
0
votes
0 answers

Error in writing compressed netcdf 4 files using raster in R

I get an error message when writing compressed netcdf4 files using r raster package ver 2.5-2. r <- raster(system.file("external/test.grd", package="raster")) s <- stack(r, r*2) writeRaster(s,"test.nc",format="CDF",compression=7) Error: Error…
Geo-sp
  • 1,704
  • 3
  • 19
  • 42
0
votes
1 answer

crop raster using another raster R

How can I crop right raster to extent of left raster below? I used: cr <- crop(right, extent(left),snap="out") fr <- rasterize(left, cr) r<- mask(x=cr, mask=fr) but did not succeed. Thanks for suggesting a work around.
code123
  • 2,082
  • 4
  • 30
  • 53