Questions tagged [stack]

stack in this context is intended for questions relating to the stacking of rasters, it is not intended for questions relating to a GIS software stack

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

How to stack multiple bands from many dates in Python?

I have this folders: and inside them there are sentinel2's raster bands. I'd like to stack them and return the stacked tiff to its folder. How do I do that?
user avatar
0 votes
1 answer
29 views

How to stack list of Xarrays

I have a folder with 4 .tiff (GeoTiff) files. Each of these contains two layers (the spectral band and a mask). I'm able to create a list containig each image using xarray.open_rasterio. Now I need to ...
user avatar
  • 343
1 vote
0 answers
47 views

Image Stacking showing is stacking all the bands in the whole image collection instead of images in the filtered image collection date

I have created my image collection of 36 images and I have mapped the NDVI function over it. I created a stacked image and assigned the kNDVI band to the image. However, it is showing 865 bands ...
user avatar
  • 15
0 votes
0 answers
33 views

Google Earth Engine: Creating a Stacked Image of NDVI from an Image collection

I wanted to create a stacked NDVI image from an image collection that has been mapped with the NDVI band. So I was wondering if I could use the toBands() to create 1 stacked Image from the collection ...
user avatar
  • 15
2 votes
0 answers
126 views

Merge single- and multi-band rasters with stars

I can easily use c() to merge two single band rasters or two multi-band rasters using the R package stars, however, when I try merging a single band raster with a multi band raster, I get the error ...
user avatar
  • 1,733
0 votes
1 answer
49 views

Remove the pixel completely in stack if one layer contains NA values in R

I have a raster stack of soil temperatures from the year 2000 to 2020. I have previously cleaned out the individual layers if they exceeded the overall mean +/- 2 std.dev. by stacked <- stack("...
user avatar
  • 772
2 votes
1 answer
83 views

Creating large covariate stacks with Google Earth Engine

I'm trialling using Earth Engine for a machine learning task (predicting pH) based on a large number (~300) of satellite covariates and around 100k training points. Earth Engine is attractive due to ...
user avatar
0 votes
0 answers
19 views

Stack 1 bit raster files to new raster file with color table

I am new to Python/GDAL. My problem is that I have a folder with 1 bit raster files. They have the exact same dimensions, projection, resolution and so on. I want to stack them on top of each other ...
user avatar
  • 1
0 votes
0 answers
20 views

Creating one raster with paletted categories from a raster stack

Basically, I've stacked a few rasters in R, and I want to create a climate classification map. I have a stack of rasters that have temperature and precipitation information. I want to make one raster ...
user avatar
0 votes
1 answer
39 views

Geolocating and writing many TIFFs at same time using R

I have found a way to give a PNG the CRS and location of a geolocated TIFF, and to convert the PNG to TIFF. Now I have to apply it to different PNGs in the same folder (all named Pt6_frame1, ...
user avatar
0 votes
0 answers
249 views

Extracting all levels of a NetCDF file and exporting as multiband raster

I am trying to convert this .nc file with land cover data from ESA CCI (http://maps.elie.ucl.ac.be/CCI/viewer/download.php). There is a separate .nc file for each year, and each file contains the ...
user avatar
0 votes
1 answer
63 views

How to keep same extent for my 10 raster files?

I am not able to keep same extent for my raster files and stack them together. library(raster) # for reproducible example r1 <- raster(xmn=72.23081, xmx=77.79537, ymn=34.26277, ymx=37.35659,res=1) ...
user avatar
1 vote
1 answer
609 views

"invalid 'times' value" error in stack function [closed]

I would like to stack multiple GeoTIFF file. My code looks like this: var1 <- list.files(path="D:/#This is the access path", pattern=".tif$", full.names=TRUE) var1 var2 <- ...
user avatar
0 votes
1 answer
54 views

Issue with raster stacking

I tried raster stacking using the below code.I tried to read pixel values at a particular coordinate and few values are coming as zero where as when I tried reading the value before stacking there is ...
user avatar
1 vote
1 answer
2k views

How to calculate mean for multiple raster files and multiple variables using R

I have a folder with multiple raster files (.asc) which contains the biomass of different fish species (e.g., Anglerfish, Bathydemersal etc) for different years (e.g., 00012, 00024, 00036 etc) I want ...
user avatar
0 votes
1 answer
124 views

Raster image error when entering stack layers using Rstudio

I am a beginning user of Rstudio, and I want to run Random Forest by using a couple of "raster layers" which were stacked in ENVI. Before doing stacking I checked the cell size and the ...
user avatar
1 vote
1 answer
21 views

Why raster stack function changes the number of layers

I have a list of 12 rasters: IN_folder_S2 <- "T:\\New_SM\\Indices_UXC" IN.files_S2 <- dir(IN_folder_S2, pattern= "_11.tif$",full.names = T) IN.files_S2 IN.files_S2 [1] &...
user avatar
0 votes
0 answers
105 views

Add NDVI Date to stacked image in Google Earth Engine [duplicate]

I have created an Image collection in GEE, and I have computed NDVI index and mapped in each Imagen from Collection. Later, I create another collection with NDVI as a band, an finally Statacked in a ...
user avatar
8 votes
1 answer
12k views

R-4.0.1 Not sure I understand this message: Warning message: In proj4string(x) : CRS object has comment, which is lost in output [closed]

Context: I want to store the TIFF data to use it for running a linear regression model later on. Ultimate goal: Create a carbon map using field data as a basis. Libraries: library(sp) library(raster) ...
user avatar
3 votes
1 answer
2k views

Calculation of mean and standard deviation of raster images in R

I have a set of raster images (GeoTIFF, Landsat 1984-2018) which I cropped with my AOI using a shapefile. Now I want to stack them and calculate the mean and standard deviation of every pixel of the ...
user avatar
0 votes
1 answer
405 views

RasterLayer vs RasterStack

I have a few hundreds of .tiff files that I converted as a raster stack. However, when I tried reading the file, it is classified as a RasterLayer. I was expecting it to be a RasterStack. The ...
user avatar
  • 161
4 votes
1 answer
979 views

stars package in R. How to add time dimension in a stars object?

I have a raster stack (my_stack) and I converted it into a stars object: mystar <- st_as_stars(my_stack) That results in: stars object with 3 dimensions and 1 attribute attribute(s), summary of ...
user avatar
  • 453
0 votes
1 answer
482 views

Subset raster stack in R by a vector of number sequences?

I have a large raster stack that I need to subset by somewhat irregular time spans. I'd like to do something like this: rstack[[c(1:3, 4:8, 9:15)]] But there are 30 sequences like the ones above ...
user avatar
  • 119
1 vote
0 answers
138 views

Merging satellite images error

I am trying to merge 3 satellite images of 3 times. The images are median images. I have used the following code but there is an error. var maskL8 = function(image_m) { var qa = image_m.select('BQA'...
user avatar
0 votes
0 answers
45 views

Multi-seasonal image stacks in GEE

I want to stack layers of 3 images (median images from 3 seasons). I want to differentiate the land uses in different seasons. for example, there will be more waterbodies in rainy season but less in ...
user avatar
1 vote
2 answers
697 views

stack() in R does not include all .tiff files in my directory

I am trying to perform stack() in R using enhanced vegetation index (EVI) time-series maps but it doesn't include all the .tiff files in my directory. Here's the list of files when I dir(files.evi): ...
user avatar
  • 161
1 vote
1 answer
533 views

Determining which layer in raster stack is first to meet condition using R?

I want to analyze a raster stack and determine the first layer in the stack that meets a condition for every pixel. Here's a reproducible code example generating rasters and making a stack. # ...
user avatar
  • 121
0 votes
3 answers
234 views

Mosaicing of multitemporal Sentinel-2 images using ENVI

My aim is to combine several Sentinel-2 Level2A images of the same location/orbit number but at different dates of a year. I would like to have different options to create that mosaicing (e.g., if ...
user avatar
  • 140
2 votes
1 answer
237 views

Biweekly time series for raster stack in r

I have a netcdf file with daily data and I calculate for each week some statistics, using the "apply.weekly" command in the "xts" library. However, I would like to calculate bi-weekly statistics, ...
user avatar
1 vote
0 answers
35 views

How do I compare multiple years worth of geomorph changes in a river while drawing one profile line?

I have many years worth of DEMs of a river I'm studying. I'm very, very new to ArcGIS (think one intro class), and learned how to use the 3D analyst tool. What I'd like to be able to do, is to draw ...
user avatar
1 vote
2 answers
2k views

Looping a raster stack with a step, R

I have a large raster stack of about 500 rasterlayers. What I want to do is to extract specific layers and store them in a different strack. The layers for which I am interested in, have a step of 8 ...
user avatar
  • 186
0 votes
1 answer
577 views

Using raster stack function time in R?

I successfully ran a function over a smaller test raster stack (48 layers) in about 30 minutes but cannot run it over my large stack (1462 layers). The last one I tried over the large stack ran from ...
user avatar
0 votes
1 answer
231 views

Plot a series of subsetted pixels from a raster stack in R

I have created two raster stacks and would like to plot a row or column of pixels through the stack, but am not sure how to approach this. I know I can subset by layer, but how do I subset ...
user avatar
0 votes
2 answers
237 views

Why does the Extent of NIR Band 8 Landsat image not match other bands, even when cropping to a specified extent?

I'm trying to load and then stack four bands 2,3,4 and 8 RGB and NIR from Landsat images. I have downloaded and extracted them and they are in .tif format. # loading the bands B2 <- raster("./...
user avatar
  • 101
0 votes
2 answers
854 views

Raster operations in a raster list in R

I have a raster list (21 in total) S1 that have the same projection, resolution but not exactly the same extent. Due to this difference, I cannot stack them without solving the extent/dimensions ...
user avatar
  • 1,038
3 votes
1 answer
7k views

Import multi-band TIFF in R

I am trying to import a TIFF file that contains 2 bands. When using the following code in R, it seems only the first band is being recognised. S1<-"my/path/" S1<-list.files(S1, full.names = ...
user avatar
  • 1,038
1 vote
0 answers
167 views

How to save statistical parameters of a raster stack in a csv using R

I have a reference raster and a stack of other rasters. I wanted to perform Mean, Std Dev and Bias of the reference with respect to the remaining. So I calculated the Cell Stats of all but when I try ...
user avatar
  • 13
6 votes
1 answer
480 views

Stacking and masking Landsat at the same time with rasterio

Based on answers from previous questions 1,2 and the Masking a raster using a shapefile guide from rasterio cookbook, I wrote the code below. The code runs correctly. I would like to improve it. 1- ...
user avatar
  • 119
4 votes
1 answer
4k views

Add bands' name and description to the Metadata when stacking using rasterio

I'm using this code, of @Loïc Dutrieux, to stack 8 Landsat bands. with rasterio.open(final_list[0]) as src0: meta = src0.meta with rasterio.open('stack.tif', 'w', **meta) as dst: for id, layer ...
user avatar
  • 119
0 votes
2 answers
794 views

Selecting layers of a raster stack using a sliding windows as a step in R in for loop

I would like to create a loop that every time selects the first ten layers of a raster stack, calculates their mean and saves it to a layer of a new raster stack. Also, I would like to have a step ...
user avatar
0 votes
1 answer
427 views

Google Earth Engine: Stack an ImageCollection

Does anyone know how can I stack all this collection? I made my own collection from January Landsat images (L7 and L5) and I would like to stack all the images to check which are the areas with more ...
user avatar
  • 373
3 votes
1 answer
3k views

Raster calculation loop - R

I have a raster stack of 108 elements The stack 'images' is created using 4 bands (RGB+NIR) of 27 satellite images. The sequence of the rasters in the stack is: Position [[1]]: blue band image 1 ...
user avatar
  • 1,038
10 votes
2 answers
12k views

How to stack bands in Google Earth Engine?

I have created an Image collection in GEE and with the help of a function I have computed NDVI index and mapped it to create another collection with NDVI as a band. Now I want the create a stacked ...
user avatar
6 votes
3 answers
11k views

Stack rasters with different origin, dimensions and resolution in R

I have three raster files with the same extent and CRS, but with different origin, dimensions and resolution. r1 class : RasterLayer dimensions : 3020, 3043, 9189860 (nrow, ncol, ncell) ...
user avatar
  • 63
4 votes
1 answer
940 views

How to create raster stack from names on R

I have a dataframe containing the best predictors by their contribution to a model: bestpredictors var contrib 2 Pfallwinter 8.1141 15 Tofall 58.0000 23 ai 5.3573 26 ...
user avatar
1 vote
0 answers
320 views

Is it possible to list SpatialGridDataFrame files to be used in a loop?

I have a lot (>50) of SpatialGridDataFrame files that I need to turn into raster files, stack with a set of raster files I already have and then extract data from random points from each layer of all ...
user avatar
  • 33
6 votes
2 answers
6k views

Mean by month on R stacked raster

I work with MODIS NDVI rasters in 2016. I have 23 rasters stacked in one object. I have 2 raster by month. I would like the average by months and conserve a raster for each month. ndvi.stack <- ...
user avatar
  • 709
1 vote
1 answer
2k views

R Stack. Extent and CRS

I'm new on R. I was listing .tif files from a folder to R. My final product is going to be a value mean of all the files in only one image. So I start stacking all of them, then brick the stack, and ...
user avatar
1 vote
0 answers
87 views

Stacking/Aligning High-Res UAV Mosaics from Different Dates in QGIS?

I have two mosaics taken in different band sets respectively, on two different flights- of a crop field. The flights were taken a day apart, so the vegetation cover has not changed. The only issue is ...
user avatar
  • 263
5 votes
2 answers
13k views

Handling multiple-extent-problem to create raster stack in R?

I am storing ~ 30 raster files in a folder and want to create a raster stack. I know that not all of these rasters have completely the same extent. They do have the same resolution and CRS. Thus I ...
user avatar
  • 1,444