Skip to main content

Questions tagged [loop]

A sequence of instructions that repeats either a specified number of times or until a particular condition is met.

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

How to run sensitivity analysis of maxent SDM in R?

I have been told that I have to run sensitivity analysis on a species distribution model. I cannot find much on this, but I suspect that it means that I would have to re-run the model 999 times, each ...
Birdman's user avatar
  • 61
1 vote
1 answer
76 views

Performing a zonal statistics looping over rasters and over polygons

I have a shapefile with overlapping polygons and a set of rasters. I would like to summarize some statistics on my polygons. However, as my polygons are overlapping, to avoid issues with zonal_stats, ...
OgeiD's user avatar
  • 566
0 votes
1 answer
43 views

Datetime from attributetable to layername in QGIS with Python

I have several (point) layers and I want for all of them this > Take the first value of the "datetime" column and append it on the layername. These point layers come from gpx track ...
Immo Woschny's user avatar
0 votes
1 answer
104 views

Corrupted zip files when I download Sentinel-2 L2A Granules using the new Copernicus Data Space Ecosystem

I would like to download Sentinel-2 L2A Granules using Open Data Protocol (OData) with new Copernicus Data Space Ecosystem. I have followed some tutorials on how to do it. https://dataspace.copernicus....
Ilias Machairas's user avatar
3 votes
2 answers
221 views

Loop through fields in QGIS calculator with condition: count fields with values >0

I have a dataset, a polygon, with several columns, let's say: Site Species1 Species2 Species3 1 85 23 90 2 73 20 0 3 0 0 0 4 0 0 70 5 0 75 60 I have different sites and data about several ...
Oriol Baena Crespo's user avatar
5 votes
3 answers
301 views

Looping every features pair with PyQGIS

I need code that loops between each pair of features in sequence (feature 1 with feature 2, feature 2 with feature 3...) but using only a for, I searched the forum and found similar code but with two &...
Mestrexama's user avatar
0 votes
1 answer
72 views

Issue using while loop in Google Earth Engine

I am trying to write an iterative procedure using the GEE Code Editor. I initially calculate a variable "AR" and if this variable is greater than a specified threshold, then an iterative ...
ESimonson's user avatar
0 votes
2 answers
100 views

Loop an operation in all features

I have a layer that has date and time information and I need the difference between this information in seconds, I managed to get close to this but I needed to loop for the difference between the ...
Mestrexama's user avatar
0 votes
0 answers
38 views

How to add attributes to a raster stack

I have a dataframe ("DataGroup"), which holds tracking data from individual birds. Each bird has a unique id ("ID"), and belongs to one of 10 study groups ("DGroup"). In ...
AMK's user avatar
  • 1
0 votes
1 answer
74 views

Repeat a process for several .csv files (containing points) in Google Earth Engine

I need to extract the time series of estimated NDWI from LANDSAT for three year (2020-2022) all around the word. I have to do this process over a regular grid (9-km) and I noticed that the process ...
Mina RahmanI's user avatar
0 votes
0 answers
39 views

Create polygons using a loop in virtual layer

I would like create singlepart polygons including polygons from layer Polygons which have the same value in their row unique_number, and fill the spaces in between. It will result several polygons : 1 ...
zlikotp's user avatar
  • 24
3 votes
2 answers
238 views

Looping area calculations for multiple rasters in R

The following code works great on individual rasters and gives me the information that I want: r<-rast("LuckSpring_2001.tif") activeCat(r)<-"Class_name" r f <- freq(r) f$...
bigblue5295's user avatar
0 votes
1 answer
1k views

Data extraction for time series, transform multiple netCDF files to spatRaster with terra in R

I would like to extract data from around 13,000 .nc files to create a time series of temperature global data in R. Each of my files contain a day worth of data of global SST (my variable of interest) ...
RGR_288's user avatar
  • 11
1 vote
0 answers
25 views

Error when running loop to section out data in R

I am attempting to run a loop in R that looks at home ranges of 27 individual animals by individual and by year. I tried running this code: df <- read_csv('animaltelemetry.csv') df<-data.frame(...
Mick's user avatar
  • 11
0 votes
1 answer
122 views

Make a loop for daily snowdepth in Google Earth Engine

This code gives me the snow depth less than 0.0254 for each day in 2021, as 0 and 1 (0 means snow depth greater than 0.0254 and 1 means snow depth less than 0.0254) but, at the end, I want an image ...
Sajjad's user avatar
  • 61
1 vote
1 answer
110 views

How to create a function or loop to import training data for several regions in GEE at once

For several supervised classifications I want to assign training data from one feature collection to several regions, for which I have a quality mosaic each. My dataset for the feature collection ...
pottsbill's user avatar
0 votes
1 answer
339 views

Calculating dNBR for Image Collection in GEE

I'm trying to calculate the differenced normalized burn ratio (DNBR) values for a Landsat image collection in Google Earth Engine for detect fire date and measure burned area using the following code; ...
Gencergis's user avatar
  • 109
0 votes
2 answers
247 views

Multiply two rasters in R, one raster has stack of 25 images, and another raster has one image

I want to multiply two rasters (one has 25 images, and the second raster has 1 image). I am using the loop function for multiplication. But I am not getting the results. library(raster) library(rgdal) ...
user221527's user avatar
0 votes
1 answer
63 views

Create several imageCollections with individual names in a loop in GEE

I am trying to create imageCollections for several regions in a loop in GEE. I am struggling with assigning them to individual variables which are available after exiting the loop. So far, after ...
pottsbill's user avatar
0 votes
1 answer
58 views

Arcpy - loop through files in 2 folders to calculate multiple NDVI files

I am trying to calculate multiple NDVI files from multiple red band files and NIR band files in 2 separated folders with the following code using python: import arcpy from arcpy.sa import * # set ...
Timko99's user avatar
2 votes
2 answers
362 views

FME Loop: Many to many connection

I have two tables with lines. The 1st table has an attribute end_point The 2nd table has an attribute start_point I want to join the first table with the second table (end_point = start_point). It ...
Theodora Vasileiou's user avatar
3 votes
1 answer
89 views

Custom ST_MultiSplit PostgreSQL function error, to split one layer with another

I have a lines layer which I would like to split with a points layer. I first created the a ST_MultiSplit function: CREATE OR REPLACE FUNCTION ST_MultiSplit(geom Geometry, blades Geometry) RETURNS ...
Ian23's user avatar
  • 75
0 votes
1 answer
75 views

ArcPy UpdateCursor - Adding different text to more than one row of a shapefile entity

I have the following code, which adds a field, and then a value to a row: import arcpy V1 = r"path/shapefile.shp" # Add CODE field arcpy.AddField_management(V1, "VERTEX", "...
MrShaggy87's user avatar
4 votes
1 answer
312 views

QGIS Python loop integer with select by expression

I want to use a loop to select values with expression in a layer. The values contain the letters OS and a number (example: "OS1","OS2"). I want to use the loop to increase the ...
Sander Van Beuningen's user avatar
0 votes
1 answer
107 views

Make a Loop for daily windspeed in Google Earth Engine?

This code give me mask out pixels where in all of wind speeds are below 5, but if I want use this code for many days what should I do? It is hard to write for 30 days. Actually, I want run this code ...
Sajjad's user avatar
  • 61
0 votes
1 answer
309 views

how write loop for time series in google earth engine

I'm trying to calculate the windspeed from a pixel many times changing the date range from an image collection. I Don't know how write loop for that: var fc = ee.FeatureCollection('USDOS/LSIB_SIMPLE/...
Sajjad's user avatar
  • 61
0 votes
2 answers
264 views

Double indexing and looping over raster lists in R

I have a list of 63 rasters. They are the same extent, resolution, projection, etc. Because I extended 62 rasters to the maximum extent of the 63rd, I introduced NA values. However, these are relative ...
Nick Masto's user avatar
0 votes
1 answer
124 views

Looping a monthly mean NDVI over a list of years

I need to calculate mean NDVI on a year-parish level in Ecuador. Parishes are the finest level of governmental structure. I have written code (heavily based on this: https://knowyourspace.dk/2020/12/...
Peter Kamal's user avatar
0 votes
1 answer
181 views

Make a loop to fill null pixels of an image with other images

I am new at Google Earth Engine and I want to fill null pixels of an image collection with pixels of complete images. In my case I want to make that in a loop, in which one the first image of a list ...
David Cerezo's user avatar
1 vote
1 answer
322 views

Loop through geodataframe, append 0 values between 2001-2021

I have produced a GeoPandas geodataframe (attached) with rows containing "loss_year" between 2001 and 2021, and some area values (pictured). I wish to append the omitted years between 2001 -...
Stuey17's user avatar
  • 199
0 votes
1 answer
143 views

trying to use a loop to buffer around multiple feature classes at once (arcgis using arcpy)

I am using ArcPy to work within a geodatabase in ArcGIS Pro. I need to create a buffer around all the feature classes of a certain type listed in a previous line of code. well_path_list lists all the ...
PieCharmer's user avatar
0 votes
1 answer
207 views

Name output feature classes with feature names with ArcPy

I would like to have my output feature classes take on the name of the input features list that I am looping through. Example output FEMA_Clip_09302022 The code below is currently creating output ...
ben's user avatar
  • 1
0 votes
0 answers
255 views

Loop through headers in CSV file and make shapefiles from each header

I am unable to figure a way out how to create a shapefile after looping through the csv files and matching the headers (dates in format Oct11/2018). Each shapefile should have all the fields with the ...
vasudha chaturvedi's user avatar
0 votes
0 answers
116 views

Looping coefficient values for raster calculator

I am trying to loop through dbf files to obtain coefficient values using calculate tool and then insert in regression equation using raster calculator to make extrapolated maps. But so far I have ...
vasudha chaturvedi's user avatar
2 votes
3 answers
2k views

How to subset a raster stack by year with a loop in R?

So I have a folder with loads of .tif files showing NDVI. What I want to do is read them into a rasterStack, then subset that stack by year. I've been able to do this manually, but I'd really like to ...
Xandian97's user avatar
0 votes
1 answer
874 views

Creating custom rectangles for SF features

I am trying to create a custom rectangle for each point in my df. I am using two functions to loop through each feature and write a new polygon output. I would like one SF data frame with each of the ...
user3777003's user avatar
1 vote
0 answers
77 views

Running multiple models within a Toolbox (.tbx) with 1 python script

I am trying to run over 80 models between 2 toolboxes. I know I can list them out to run them (example #2) but is there a way to iterate/loop through each model and run them one at a time without ...
AndrewT's user avatar
  • 11
1 vote
3 answers
534 views

Create multiple rasters from single spatialpixeldataframe, by Unique id

I have a SpatialPixelDataFrame (spdf) which contains gridded values (UD) for different Unique id's (n = 21). I would like to create an individual raster for each Unique_id, with value (UD) as the cell ...
user303287's user avatar
0 votes
1 answer
77 views

Using a dynamic formula with parrallel kringing in R

I am trying to achieve parallel Kriging in R on several variables using a loop. Here is a reproducible example using data meuse and a code for parallel kriging that I found here. In the code below, ...
ePoQ's user avatar
  • 611
0 votes
1 answer
108 views

Looping to do cloud mask for several raster files in R [closed]

I have over 200 land surface temp (LST) rasters and I want to mask each LST raster using the corresponding cloud Mask raster. The working directory has two folders one for LST and one for cloud Mask. ...
aorali's user avatar
  • 9
1 vote
1 answer
99 views

Iterative computation over image collection and multiple indexing in GEE

I am having two image collections, sc, data(Sentinel 1 data). I need to do an iterative type of computation where I need to use previous output for the next iteration and also multiple images using ...
Chandra Prabha's user avatar
0 votes
0 answers
213 views

Incorrect number of dimensions in creating multiple plots using a for loop with ggplot2

I'm trying to map out all these different "solutions" from the prioritize model using ggplot. (To preface I'm very new to R so perhaps my code/methods are extremely rudimentary and why I'm ...
Nikita's user avatar
  • 1
1 vote
1 answer
271 views

Merging rasters from multiple days in loop using ArcPy

I'm using ArcGIS Pro 2.9.3, and I want to use the Mosaic to New Raster tool to merge groups of rasters. I have many days that each have multiple rasters within them. For example, I have July3a.tif ...
Beck's user avatar
  • 301
1 vote
0 answers
99 views

joinbylocationsummary with loop on the same input layer using PyQGIS

I have adapted a script to use "qgis:joinbylocationsummary" in a loop. I would like to adapt it so the loop adds all the .shp of the directory 'layers_I_want_to_add' to join their maximum to ...
Fanny Chagnet's user avatar
1 vote
1 answer
98 views

Optimal workflow for automating placing points that represent clusters (between QGIS, FME, Python)

Ultimately I would like to automate the process of generating clusters from points (representing buildings and amenities within a neighbourhood), and placing points at street intersections which are ...
user200934's user avatar
1 vote
0 answers
425 views

QGIS Python script crash when looping many times (memory problem?)

I'm having trouble with a part of a Python code that does many iterations (about 5000). The problem found is that the program crashes, it returns an error (sometimes memory error, other times all QGI ...
Peter's user avatar
  • 31
0 votes
1 answer
230 views

Loop chapter with map

I need to create a document to show the interventions done in different neighborhoods, I´d like to do it on a loop as the maps are all the same, except with different shapefiles that are named the ...
Agustina's user avatar
0 votes
0 answers
83 views

Python script to turn off a checkbox in all layers in ArcGIS Desktop

I need to remove the check for all the layers on a map that has the "UT Simbology" check. I am not really sure If I could use update layer because this is an extension developed by a GIS ...
Juliana's user avatar
  • 31
0 votes
0 answers
53 views

PyQGIS actions does not work for second half of the loop

I have a folder with 1600 subfolders. I've developed an script to merge two shapefiles from each subfolder and store the result in the same subfolder. I ran the script and it worked well. However, ...
Morteza Yaqubkhani's user avatar
0 votes
1 answer
780 views

ArcPy Spatial Join Loop use the output layer as the target feature

I am trying to generate a script that executes a Spatial Join between specific shapefiles. However the only values that are added to the result feature are the first and last in the list of shapefiles ...
MigueL's user avatar
  • 113

1
2 3 4 5
8