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
7 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 ...
  • 1
0 votes
0 answers
13 views

How to apply "where" condition for an image collection

I am trying to create annual wetted channel for multiple years which I have to do 3 noise removal steps after calculating MNDWI. But I realized that there is an error in the second step (minSize line ...
-1 votes
0 answers
21 views

Exporting unique output names with Clip in ArcPy [duplicate]

I am trying to complete this simple Clip analysis loop, but I am having trouble getting my output features to export with unique names My goal is to have my have my output features save into my test ...
  • 1
0 votes
0 answers
11 views

ArcGIS Pro Model Builder: Not all intermediate datafiles are deleted after run of a model with a loop

I have created a model (in ModelBuilder ArcGIS Pro) with a loop and some of the intermediate results marked as 'intermediate'. When I run the model, only the intermediate files of the last run in the ...
0 votes
0 answers
45 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 ...
0 votes
0 answers
41 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 ...
0 votes
0 answers
26 views

Loop in the graphical modeler

I'd like to know how to create a loop (an iterated process) in the graphical modeler of QGIS. For example, i need to create some buffers of a point layer, based on a value entered by the user in the ...
  • 769
1 vote
3 answers
131 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 ...
0 votes
1 answer
56 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 ...
1 vote
0 answers
21 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 ...
  • 11
0 votes
3 answers
45 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 ...
0 votes
1 answer
55 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, ...
  • 561
0 votes
0 answers
44 views

Looping monthly for 2 years in Google Earth Engine

I would like to extract nitrogen dioxide from Sentinel-5P for an area of 50,000 sqkm monthly mean for 2 years. As I am new to GEE, I don't know how to run loops. I would like to download the output (...
0 votes
1 answer
31 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. ...
  • 9
1 vote
1 answer
44 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 ...
0 votes
0 answers
87 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 ...
  • 1
1 vote
1 answer
71 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 ...
  • 181
1 vote
0 answers
33 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 ...
1 vote
1 answer
36 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 ...
1 vote
0 answers
202 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 ...
  • 31
0 votes
1 answer
95 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 ...
0 votes
0 answers
59 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 ...
  • 21
0 votes
0 answers
41 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, ...
0 votes
1 answer
155 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 ...
  • 93
0 votes
0 answers
38 views

Create the loop for multiple raster convert to vector polygon using the arcpy scripting tool

This is my code which works only with the one raster image. But I need to create the tool that converts the multiple raster to vector in loop with arcpy. import arcpy from arcpy.sa import * arcpy.env....
2 votes
1 answer
176 views

Raster calculation with conditions in R

I have two rasters (A,B) with the same resolution, extent and crs. Now I would like to generate a raster C with the value 1 for each cell that have a value of 30 or higher in A and B. I use a loop, ...
  • 119
0 votes
0 answers
233 views

How to multiply one NetCDF file to multiple NetCDF files

I have one NetCDF file (region.nc) that I want to multiply to multiple NetCDF files such as the one in the picture using -mul from CDO.: The output should be new NetCDF files resulting from the ...
  • 25
2 votes
1 answer
58 views

Using ArcPy to iterate feature classes for kriging

I have 12 feature classes and they are named from net_0 to net_11 but the order of feature classes In Arc catalog is,List_wells = [net_0,net_1,net_10,net_11,net_2,net_3,net_4,net_5,..net_9]. I used ...
  • 23
1 vote
1 answer
98 views

Raster Calculation through two iterative loops in R

Here is a list of files I would like to create a loop with for a raster calculation "J:\NAIP\temp5\m_4208902_nw_16_1m3m_sd.tif" "J:\NAIP\temp5\m_4208902_nw_16_3m_sd.tif" "J:\...
  • 67
4 votes
1 answer
190 views

Comparing polygons from zip lists inside a loop, whose data comes from user in Python

I have made a program that calculates area and perimeter based on 2D coordinates (latitude and latitude) given by the user, asking if they want to include more coordinates from the third pair, and ...
4 votes
1 answer
101 views

Printing zip lists whose data comes from input user in a loop

Printing zip lists whose data comes from input user in a loop I have made a program that calculates area and perimeter based on 2D coordinates (latitude and latitude) given by the user, asking if they ...
2 votes
1 answer
179 views

NetCDF in QGIS --constructing time series using 1368 bands

I have the NetCDF file that contains monthly gridded temperature from 1900 to 2014 (air.mon.mean.v501.nc). The goal is to extract monthly time series for every polygon in my shapefile. Using the US ...
  • 21
1 vote
0 answers
392 views

Export images by loop function in Google Earth Engine (error: invalid JSON)

I want to export data from the FireCCI V51 product in GEE using a loop function for the years 2001 - 2016 for my studyarea. However, when running the code, the error "invalid JSON" appears. ...
  • 11
2 votes
1 answer
74 views

Iterating through attribute in layer to create new layers

I am working on the school project in QGIS, in which I have Price map of the buildings in a vector layer. Each polygon has its price attribute. The maximal value of price is 20 000. I would like to ...
  • 63
1 vote
0 answers
56 views

Creating NDVI tiles from NAIP tiles in R Loop

I have a folder with many 4 band NAIP .tif tiles, band 1 = Red, band 4 = NIR. In R I would like to create/calculate unsigned 8-bit NDVI images for each of the tiles in a folder. I would like to write ...
  • 67
0 votes
1 answer
115 views

Custom Portal GP Service fails for unexplained reason [closed]

I have written a script to create a smoke plume from user inputs (it draws a giant triangle) and then update a number of structure features that are touched by the smoke plume. It works in ArcMap, but ...
  • 21
1 vote
0 answers
63 views

Use ModelBuilder to project rasters from 600 folders into subfolders in each folder [closed]

I have 600 folders, each folder contains a raster (IMG) and I want to project each raster from one coordinate system to another and generate new folder in the source folder to contain the projected ...
0 votes
1 answer
78 views

Google Earth Engine: Sampling through image collection [closed]

I am trying to get samples from each image in an image collection and merge them into a single feature collection. So, I wrote the following code (https://code.earthengine.google.com/...
8 votes
1 answer
196 views

Creating multiple buffers in a loop in GEE

I would like to do 50 buffers from a known point. I know to do one by one, but I would like to do in a Loop. Is there any way to do it? This is part of my code: var buff1 = ee.Geometry.Point([-46....
0 votes
2 answers
43 views

Getting SyntaxError when trying to loop through shapefiles in folder, calculate Euclidean distance and save files with appended name using ArcPy

I want to loop through shapefiles in a folder, calculate Euclidean distance and then save the files in an output folder with an appended name in arcpy. I want the name to be the filename with "...
  • 412
0 votes
1 answer
144 views

Loop Issue: Extracting mean temps for each layer of RasterStack (NetCDF File)

I am running into a little bit of a problem with a RasterStack loop. I am trying to extract the mean temperature for each county in North Carolina for each hour over the last 10 years. I am able to ...
  • 1
1 vote
2 answers
56 views

ArcPy.da.SearchCursor not cursor-ing

I am using ArcMap 10.8.1. I have shapefiles that are a series of overlapping polygons of drone imagery footprints. I want to loop through each shapefile, and for every shapefile loop through and ...
  • 613
1 vote
0 answers
98 views

Loop through folder and join pairs of files with the same prefix

I have two sets of shapefiles that I would like to join based on a similar field. They are all stored in a path folder which is stored as the variable "steps". One group of shapefiles are ...
  • 613
3 votes
1 answer
434 views

Iteration over features in PyQGIS processing modules

I have an issue with processing.run commands where I would like to do an iteration over features in a layer with polygons. zsj = QgsVectorLayer("/data/grassmaster/testVlado/zsj_ba_test.gpkg",...
  • 31
0 votes
1 answer
372 views

How to apply cdo mask command to loop over multiple .nc files in Python?

I want to use the cdo command for masking the .nc file (the command below): cdo div input.nc maskfile.nc outputfile.nc The command above should be applied over multiple .nc files (looping) in python, ...
  • 25
1 vote
4 answers
445 views

Changing extent of raster in loop using R

I have raster objects of a certain extent (0, 360, -90, 90) and I want to change that extent for all of them to a different extent (-180, 180, -90, 90). The thing is that I have my objects (raster ...
  • 13
4 votes
1 answer
438 views

Using PostGIS to find the overall difference between two (large) polygon datasets

I need to get the Difference of an input layer with ~30k polygons and an overlay layer with ~500k polygons (of which ~200k intersect the input layer). I am trying to learn PostGIS to do this, as it ...
  • 155
1 vote
0 answers
143 views

GEE: How to iterate through a feature collection to calculate annual average indices from MODIS for each feature

I am trying to calculate the average annual vegetation condition index from MODIS data for a set of raions (districts) for spring months (march, april and may). I am wanting to export this data to a ...
  • 745
2 votes
2 answers
274 views

Getting names and numbers in specific vectors from a dataframe in a loop R

I have a huge DataFrame, in which I need to extract some information that generates filenames that I need to search in my working directory later, I also need the value in each cell of the pixel ...
2 votes
2 answers
859 views

Iterating over dates to extract precipitation in Google Earth Engine

I'm looking to sum precipitation for a period of 10-days prior to a specified date. This is just an example - in fact, I have around 60 different dates and I don't want to select each the date ...
  • 23

1
2 3 4 5
8