Skip to main content

Questions tagged [iteration]

Repeated execution of some groups of code statements.

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

Issue with Iteration/Unique Naming in QGIS Model Building

this is probably a straightforward problem, but I am a beginner at QGIS and having trouble fixing it. The Task I am trying to use a vector of polygons as masks to individually cut out snips of a ...
lGISmor's user avatar
0 votes
1 answer
57 views

Creating QGIS projects with iteration using PyQGIS - Problem with the location of layers added

In the following PyQGIS script, I iterate through each shapefile in input_directory, where each file represents an individual prefecture. To manage project isolation and ensure clean operations, I ...
Ilias Machairas's user avatar
0 votes
1 answer
70 views

Iteration of daily Fire Weather Index (FWI) calculations for the region of interest in Google Earth Engine

I decided to find out how the FWI index works for operational monitoring of the fire situation in the region. This is my first project on Google Engine and my programming knowledge leaves much to be ...
Mikita Rahouski's user avatar
0 votes
0 answers
44 views

Iterating over .getFeatures()

I've selected some polygons and created bounding boxes for them, then generated buffers. Now, I need to export each buffer to a separate .gpkg file. However, this loop saves all buffers multiple times ...
Jaguarundi's user avatar
0 votes
1 answer
46 views

Using PyQGIS to iterate through layers with custom layout

How do I select the layer and apply a layout for export to .PNG? I use: QGIS 3.34 and the Python Console. So the manual process is: select layer => go to Layout Manager => Select Layout => ...
Cerveser's user avatar
  • 101
0 votes
1 answer
55 views

Mapping, Iteration and conditional selection on featureCollection in GEE

I want to make a function (possibly using Currying method) in GEE to do a modification of my featureCollection. In the code bellow I wrote a function_infunction to add a new property "label" ...
Sina NAKHOSTIN's user avatar
0 votes
0 answers
53 views

Adding iterative group of algorithms to QGIS model

In a QGIS model, I have a section in the workflow where a certain group of algorithms (let's say: do A, then B, then C, then D: see below for details) has to be re-run until a condition is met. So ...
Babel's user avatar
  • 73.1k
0 votes
0 answers
46 views

QGIS Shortest Path Iteration

I have a large QGIS Fiber to the Home (FTTH) design with 727 address, my focus here is on the Lateral sections from the homes to the Handholes (shown in green). The design roughly breaks up to four ...
Joe G's user avatar
  • 191
3 votes
0 answers
64 views

Change to unique layer name when Iterating over a set of layers

I am using the Clip algorithm with the 'Iterate over layers' option, which works great, but the output names are just 0 - 17, which isn't terribly helpful, as I don't know which shapefile is ...
Joe G's user avatar
  • 191
3 votes
2 answers
253 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
0 votes
1 answer
72 views

Using "Subdivide Polygon" in ModelBuilder with an iteration via the split angle (value from input feature class) to split polygons in their centres

I have a lot of polygons that I would like to split automatically in the centre/into two equal parts in ModelBuilder. My idea was to first determine the orientation of the polygons using the Minimum ...
Valerie's user avatar
1 vote
0 answers
67 views

Setting output layer names in processing algorithm with stepwise parameter increment in QGIS

I run a processing algorithm in QGIS in an iteration with a stepwise parameter increment from numeric model input A (minimum) to numeric model input B (maximum) by a fixed step size. Here's what the ...
winnewoerp's user avatar
  • 1,504
1 vote
1 answer
143 views

ArcGIS Pro ModelBuilder Rename invalid characters

I want to take all shapefiles within a folder, import to a new gdb, and iterate several processes. Including rename, add and calculate fields, then define the projection. I keep running into issues ...
CarteCraft's user avatar
1 vote
1 answer
69 views

Iterate feature classes then clip, but skip if output is empty

I want to make a ModelBuilder tool that takes shapefiles from a specific folder and clips them. The shapefiles cover an entire country and I have to clip them to project areas when we have new ...
David's user avatar
  • 55
0 votes
1 answer
47 views

Model Builder - Iterate user selected KML files as input - NOT a folder as input

I am trying to create an iterative KML to layer geoprocessing model. The goal: I want to prompt the user to select specific .kml files in a directory to process as well as prompt for the output folder....
AGOOFYMO's user avatar
2 votes
1 answer
92 views

Iterating over LineString and applying filter in PostGIS

I want to iterate over a LineString and apply a filter so that I create a new LineString with those points that succeed in the test. How do I do that? My goal is to find some outliers that are too far ...
rablentain's user avatar
1 vote
1 answer
74 views

Creating variograms in a loop in R

I have a data frame of parameters to create variograms of different columns of a geographic dataset. I haven't found a solution yet to make the object argument of the variogram() function dynamic. ...
winnewoerp's user avatar
  • 1,504
0 votes
2 answers
43 views

QtPy Running a process looping through features

I'm writing an iterator to run a processing on an individual feature of a layer. In this example: gray region included green bordered cells and black points. I want to run a processing 'count points ...
Adam Korejwo's user avatar
0 votes
1 answer
230 views

Iterating over a feature collection to filter images in an image collection according to a list of months

I am trying to iterate over a feature collection which has 10 features located away from each other and does not necessarily fall in same scene of satellite image. So what I want is to to call each ...
Ishwar's user avatar
  • 1
0 votes
1 answer
31 views

Iterator reports only last inpust shapefile - Merging multiple shapefiles into a single geodatabase feature class

]I have 10 shapefiles in source folder. I made a model, which use iterator iterate feature classes and tool the feature class to feature. I would like to merge multiple shapefiles into a single ...
Lucy's user avatar
  • 1
0 votes
1 answer
30 views

Iterating process of removing values in fields of shapefiles using ArcMap ModelBuilder

I have a file geodatabase containing about 179 shapefiles. In each of the shapefiles the attribute table in the fields (Ref: Picture), rows with same values are present which is identified from field, ...
digital.br's user avatar
3 votes
1 answer
104 views

Iterate extracting a group of all points that intersect each feature in a polygon shp in QGIS

I have a polygon shp with agricultural fields and a point shp representing GPS locations. I would like to create separate point layers for each field the features intersect. Below is a screenshot of ...
Barbara Perez de Araújo's user avatar
3 votes
1 answer
513 views

Choose all the files of a folder as an input to run a process in the model designer in QGIS

I hope you can help me with this. I have this in the model designer and I looking for a solution because I need to run this process in many layers (150) and I dont know if is possible to select a ...
Carlos Cárdenas's user avatar
1 vote
1 answer
257 views

Iterate through an imageCollection to subtract value of the previous image in GEE

I am using the Sentinel-2 time series to identify the timing of forest disturbances using Google Earth Engine. I calculated the Normalized Burned Ratio (NBR) Index and I filled in the gaps in the time ...
sermomon's user avatar
  • 994
1 vote
0 answers
45 views

ModelBuilder with iterate raster - Tools won't overwrite temporary rasters from the previous iteration due to schema lock

I have a model based on an iterate raster. One of the steps is to create a 'temporary' Viewshed, which after the subsequent process is intended to be overwritten by the next iteration. However when ...
Psoralea's user avatar
0 votes
1 answer
117 views

Script won't iterate through text files in folder

Would anyone be able to tell me why the script won't iterate through each text file? The script runs successfully (Python 2.7), but does not populate GasLines_Final polyline feature class with ...
javierjleija's user avatar
1 vote
0 answers
21 views

Subtracting different values from each related raster file with iterate field values tool in ModelBuilder

I must extract values by point (just one point) from multiple TIFF format rasters and then multiply these values with -1 and add them to the raster files with raster calculator. As what you can see ...
coral's user avatar
  • 81
0 votes
1 answer
282 views

Iterating over GEE cloud assets in JavaScript produces "undefined"

I'm trying to to make my javascript Google Earth Engine code iterable, in the sense that I run the code once and it iterates through all of my cloud assets in a given folder. Each cloud asset ...
user5858's user avatar
  • 405
2 votes
0 answers
48 views

Iterate using model output and multiple distinct (grouped) inputs

In QGIS 3.26 I have the following model (ERASE target layer from base layer), and I'm trying to iterate over the model so that the output layer is automatically entered as the input layer into the ...
greyhug's user avatar
  • 77
0 votes
0 answers
95 views

Layer iteration in QGIS with Python

I have been reviewing all the questions on the site that are similar to mine. I have code that was sourced from Graphical Modeler. Now I need to iterate the dots2 layer using Python. I understand that ...
KyBik RyBik's user avatar
3 votes
2 answers
296 views

Create series of heatmaps for each year in QGIS

I'm working with QGIS 3.22.10-Białowieża and I've got a point layer with the attribute year. I need to create a series of heatmaps, one for each year, but I haven't found any filtering option in the ...
jpinilla's user avatar
  • 3,230
0 votes
1 answer
234 views

Where-clause based on attribute value in ArcPy

I am trying to create a Python toolbox which will iterate through selected features and create a statistics table for each selected feature. It works as follow: Define parameters, including the input ...
Juliette Lapeyre's user avatar
1 vote
0 answers
80 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
0 votes
0 answers
92 views

Location allocation with a maximum occupancy and distance

I am working on a project where students can be assigned to multiple schools. I have the location assignment with the plugin QNEAT3 and the OD Matrix. In this was calculated from each school the path ...
user avatar
1 vote
1 answer
443 views

Keep image properties in iteration function in Google Earth Engine

I'm very new to GEE and programming in general. I have this code that filters Landsat 5 imagery, creates a collection of NDVI layers, clips the NDVI layers, and creates mosaics of two NDVI layers of ...
Deus's user avatar
  • 11
1 vote
1 answer
104 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
1 vote
1 answer
807 views

Adding all images from a list to map in Google Earth Engine

How can I add all the images contained in a list in GEE to a map? I am trying to learn how to iterate (instead of manually acquiring images for each year) and have learned that there is no for loops ...
Matechik4's user avatar
0 votes
1 answer
34 views

Converting extent to int is changing value [closed]

I am iterating to get extents (XMin, XMax, YMin, YMax) of each feature (1 deg x 1 deg polygons). The values of the extents parameters are double precision and display to one decimal place. I need to ...
atv5150's user avatar
  • 63
0 votes
2 answers
125 views

Iterating over (selected) features by the same id

I have a feature class Test_NearestNeighbor_Code. This feature class has 7373 polygon features and a column/ field called osm_id. I want to do a calculation with all features that have the same osm_id....
Mr.Zab's user avatar
  • 3
0 votes
2 answers
226 views

Iteratively Mosaicing Multiple Raster Pairs by File Name in ModelBuilder

I'm trying to run 'Mosaic to New Raster' iteratively across 500 raster pairs in ArcGIS ModelBuilder. Either this tool or my model is not working. Intuitively, the model is correctly specified, but ...
Sean Sloan's user avatar
1 vote
0 answers
428 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
1 vote
0 answers
46 views

Assembling output into one shape when loop is used in python script in QGIS3?

I’m writing a new processing script for QGIS 3 using a for loop in the code. The "problem" is that if I try to iterate N times, N shapes are generated in output. I would like to have only ...
Peter's user avatar
  • 31
0 votes
1 answer
111 views

All rows are being overwritten with last features value using arcpy.da.UpdateCursor

I am trying to populate fields based on objects. When trying to use Update Cursor it overwrites all of the row values with information from the last feature read. I am sure that I am meant to get it ...
Stratasaurus's user avatar
3 votes
1 answer
45 views

number the soil_unit_code in a soil_id column

I believe its pretty easy to be done, but I just don't seem to see the solution in Qgis. Is it possible in the field calculator? I've an attributetable with 200 features with like 20 different ...
ThomasHaarlem's user avatar
0 votes
1 answer
4k views

Finding if point is in polygon then taking attribute from polygon dataframe and inserting it as a column in the point dataframe

I'm doing some GIS analysis in Python for COVID work. I've geocoded our entire membership (gdf_schoolAgedChildren) base and captured their locations in a shapely point data type (for each member). I'...
denpxc's user avatar
  • 11
7 votes
1 answer
1k views

Iterate over features in a model

In QGIS Modeler I want to iterate over vector feature in two layers so that each iteration the inputs are: Layer 1 feature 1 - Layer 2 feature 1 Layer 1 feature 2 - Layer 2 feature 2 Layer 1 ...
Bera's user avatar
  • 74.8k
3 votes
1 answer
212 views

QGIS iterative rasterize naming

I am working on a PyQGIS script that gives similar behaviour to the GeoCube package. Specifically, I want to create a bunch of rasters from vector data for a selection of fields. For example, if I ...
Fee's user avatar
  • 1,210
1 vote
1 answer
319 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:\...
mdn's user avatar
  • 67
0 votes
2 answers
330 views

Running same action multiple times in ModelBuilder model with increasing expression value

I have created this ModelBuilder model in above expression value is 1 by default but I want to run expression value 2,3,4,5 and up to 50 (it may vary based my dataset). I tried for while iteration ...
RakeshReddy Posham's user avatar
3 votes
1 answer
402 views

Shortest path (point to point) in iteration, safe for the case there is no route

I am using Network Analysis > Shortest path (point to point) to compute the distance between two points, following a street network. Here is the code: n=0 for f1 in layer1: #Coordinates from ...
divko's user avatar
  • 65

1
2 3 4 5