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

Python - Write Raster with gdal

I want to write a raster with gdal within a function. def WriteRaster(InputArray, OutputFile, NROWS, NCOLS, XULCorner, YULCorner, Cellsize, wkt_projection): driver = gdal.GetDriverByName("GTiff") dataset = driver.Create("%s", NROWS, NCOLS, 1,…
Lerchengott
  • 13
  • 1
  • 3
1
vote
0 answers

Importing elevation data into geoviews/holoviews (data format)

How do you import other raster formats into geoviews/holoviews other than the netCDF files shown in the tutorials? For example I want to import an ESRI .bil file and wrap it into a geoviews image but it is not importing correctly. Is there a way to…
BenjiDa
  • 11
  • 3
1
vote
1 answer

Inputting a function which returns a list into calc() in R

I create a logistic function, "fun", that calculates several parameters, ie: SOS, EOS, LOS, SPUDOY, and P_Tamplitude, using a .envi raster file. Ultimately, I would like to generate separate plots for each parameter. I use calc() to perform "fun"…
Candice
  • 31
  • 8
1
vote
1 answer

Error in ncvar_get - NetCDF to Raster conversion

Trying to convert NOAA Snow data (NetCDF) into Raster format in R. This data has been pre-processed by me in CDO (interpolated from weekly-daily). library(raster) library(ncdf4) nc<-nc_open('NOAA_Snow_JanJune2016.nc') # extract variable name, size…
Ndharwood
  • 123
  • 3
  • 11
1
vote
1 answer

How to get point coordinates in same projection as raster

I'm trying to plot some points on a raster (which has a OSGB36 projection), but the points x and y positions are in a different extent to the plotted raster. How can I get the points to be in the same coordinate system/extent as the raster, so they…
user3384265
  • 173
  • 11
1
vote
1 answer

Change raster values within a %>% pipe

I have a raster where the data I am interested in (a species presence) value is 1, and the rest is either 0 (absence) or NA. I am trying to use magrittr and dplyr and, inside a pipe, I would like to change all 0 values to NA, so I can later trim the…
Javier Fajardo
  • 737
  • 1
  • 10
  • 22
1
vote
1 answer

R How to extract the mean values of a raster for each polygon for an altitude greater than 600m?

First, I managed to extract the average raster temperature values for each polygon, with the following program: You can download the GIS layers on this link : https://depots.univ-perp.fr/get?k=iTzEDSUkdyZVw2st78G ## load packages library(raster);…
tazrart
  • 167
  • 1
  • 15
1
vote
1 answer

Extract values along customized circular strips (constant radial distance) from raster

I have a large raster object which was imported from a .tif image file. I want to analyze pixels of this raster, at a given radial distance from the center, in order to identify certain axisymmetric phenomenon that I can notice in the image (below).…
1
vote
0 answers

ggplot raster and contour not work

ENV R 3.3.2 I am plotting raster contour plot using ggplot follow sample code: library(ggplot2) v <- ggplot(faithfuld, aes(waiting, eruptions, z = density)) v + geom_raster(aes(fill = density)) + geom_contour(colour = "white") My code and…
Nick Dong
  • 3,638
  • 8
  • 47
  • 84
1
vote
1 answer

Calculate area for different land cover classes in a raster in R

How can I get the the total area of my land cover classes 1,2,3,4,5 given the following example: library("raster") r <- raster(nrow=10, ncol=10) r<-setValues(r,c(rep(1,20),rep(2,20),rep(3,20),rep(4,20),rep(5,20))) One approach might be to subset…
joaoal
  • 1,892
  • 4
  • 19
  • 29
1
vote
1 answer

Saving raster in R using png() and levelplot results in strange lines

I think I may have discovered a bug. I'm using levelplot in rasterVis, when I plot the rasters they show up fine in the raster window, however when I try and save them using png() the raster has lines through it.…
GISHuman
  • 1,026
  • 1
  • 8
  • 27
1
vote
0 answers

Speed-up time to plot Spatialpolygonsdataframe extremely long in R

I am making plot in R of some SpatialPolygonDataFrames, but it takes forever. I needed three hours to save to a png the plot of one of these layers that has 314 elements and weights (as said by RStudio) 35 Mb. I do not know if that is a lot or not,…
Javier Fajardo
  • 737
  • 1
  • 10
  • 22
1
vote
1 answer

3D raster stack plot

I have a raster stack with 2 layers which correspond to 2 elevations. Every layer is a raster with Lon and Lat coordinates with value 1 (all missing values are NA), forming polygons. RasterStack example r1<-raster(xmn = 2.5, xmx = 3.3, ymn = 42, ymx…
ADM
  • 13
  • 5
1
vote
1 answer

ImageMagick to write image file row by row (or band by band)

Does ImageMagick (C API MagickWand) have a functionality to generate an image file (.jpg, .tif) using RGB raster data? If so, can it also generate an image file band by band, meaning write few rows at a time until it writes the whole image? Or one…
Megool
  • 963
  • 2
  • 8
  • 29
1
vote
0 answers

using layout to plot rasters with a common legend

Follow-up to this question. I am trying to plot 4 different rasters with a common scale (legend). I have managed to do it but now I want to plot them in the same graphic device, with the scale showing just once, at the right side of the device, and…