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
1 answer

r plot multiple ggplot, stat_smooth on png

I'm trying to plot multiple dataframe with smooth line using ggplot() or stat_smooth() with a png as a background. I have three dataframes data1 <- data.frame(Max.x, Max.y) data2 <- data.frame(Med.x, Med.y) data3 <- data.frame(Min.x, Min.y) …
Bryan Han
  • 67
  • 6
1
vote
2 answers

How to adjust two maps with different extent in R

Two maps with different extents I am using R to process two maps (raster package). I have two maps with both WGS84 coordinates see figure. But one layer is from -180 to 180 in longitude (the map on surface) another one is from 0 to 360 (the map on…
1
vote
1 answer

current r codes take longtime to extract climate data from worldlcim, how to make this faster

Currently my code is taking too long to extract climate variables from the [worldclim][1] dataset. I would like to download the climate data from the link and find the maximum temperature over my species distribution polygons and save as a CSV file…
Tiny_hopper
  • 380
  • 1
  • 4
  • 15
1
vote
1 answer

create a mask of NA values of bioclimatic variables from WorldClim in raster format in R

I have downloaded the 19 bioclimatic variables from Bioclim and I want to create a unique mask for all the 19 variables. The mask should exclude the pixels that have NA value in any of the 19 variables. This procedure is needed for further SDM…
Gabriela
  • 21
  • 5
1
vote
3 answers

Rasterize error: Polygon to raster conversion produces horizontal lines

I am working with shapefiles in R that I need to convert from polygon to raster. While the vectors look perfect when plotted, when converted to raster using 'rasterize' they produce erroneous horizontal lines. Here is an example of the…
MCNC
  • 69
  • 6
1
vote
0 answers

Local error when using crop from raster package

I imported raster files into R (Landsat TM-5 surface reflectance products). Now I want to crop these rasters using boundaries of my test region (also raster file). Importing went well without any mistakes. But when I tried to use crop function I've…
Elena
  • 13
  • 7
1
vote
0 answers

How to extract data from thousands of rasters and save into new dataframes

I am working with climate data in R, I have 3 folders of raster maps: temperature (tmax,tmin) and precip (RF) - 9131 rasters in each folder, 27393 total. I need to open each raster and extract data for every Spatial Point (284479 pts) and save the…
1
vote
2 answers

trouble loading an ESRI ArcGrid export file (e00) in R

I am trying to load an ESRI ArcGrid export file into R. The file is located at- ftp://ftp.epa.gov/castnet/tdep/grids/n_tw/n_tw-2013.zip. The documentation for this file states, "Gridded data of the above variables are available in compressed ESRI…
colin
  • 2,606
  • 4
  • 27
  • 57
1
vote
1 answer

ggplot a function of both axes as a raster?

I want to fill a raster with a function of the x and y axes. My best guess was something like this: library(ggplot2) df <- data.frame(x = c(-20,20), y = c(-20,20)) f <- function (x, y) x * y ggplot(df, aes(x,y)) + stat_function(fun = f,…
Gregory
  • 4,147
  • 7
  • 33
  • 44
1
vote
0 answers

Function to calculate the area in hectares of a class in raster?

I have been working in R-GIS for some time and now I start to need a function to calculate the area of pixels in hectares, but with the raster in lat/lon coordinates and in degree resolution. It works, but if someone could improve some parts to use…
1
vote
1 answer

Converting raster (tiff) image to a pixel image in R - problems when converting spatial polygon into owin object class

I am not an R expert, but i use it for all kinds of image processing. Now I am trying to apply Gaussian blur smoothing (spatstat package) on my satellite S-2 image. Original type of my image is Raster (Raster layer) tiff, actually a subtract image…
Ursulka Siete
  • 143
  • 1
  • 10
1
vote
1 answer

Missing color when plotting a raster

When I try plotting a Raster object, R gives a plot without colors. library(raster) r.base <- raster(ncol=40,nrow=40,xmn=-74,xmx=-34,ymn=-34,ymx=6) wgs<-"+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0" projection(r.base) <-…
eliascis
  • 317
  • 2
  • 10
1
vote
0 answers

R - Crop for JPEG Impages

I'm trying to plot a image (a flag) on a map using raster layers and # Load packages library(maptools) library(raster) library(jpeg) # Read in a jpeg and convert to raster usa.flag <- as.raster(readJPEG(".../usa.jpg")) # Get spacial image of…
waealu
  • 331
  • 1
  • 9
1
vote
0 answers

R: error when choosing 'by' column in raster::subs

i'm using the raster::subs function to replace values in a raster with values in a data.table (and data.frame), using a primary key, but am getting the errors: Error in .local(x, y, ...) : 'by' is not a valid column name and sometimes; Error in…
Sam
  • 1,400
  • 13
  • 29
1
vote
1 answer

Extracting sds from MODIS LAI/FPAR hdf format using gdalUtils library

I am trying to extract all layers of the MODIS LAI/FPAR imageries using gdalUTILs library, I am getting this error, could anyone help me out of this I am trying to use Get a list of SDS names sds <-…
amit haldar
  • 129
  • 1
  • 10
1 2 3
99
100