Questions tagged [iteration]
Repeated execution of some groups of code statements.
194
questions
1
vote
1
answer
26
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 ...
0
votes
1
answer
26
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 ...
0
votes
2
answers
74
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....
0
votes
0
answers
25
views
Google Earth Engine Raster Difference Loop
So I'm really not able to figure out how to generate a raster difference map and iterate it through the entire image collection.
I have an image collection that I added an "NDVI" band to ...
0
votes
2
answers
37
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 ...
0
votes
0
answers
52
views
Iterating classifier over an Image collection in GEE
we are trying to run the random forest classifier for multiple images in an image collection. Please let us know how to do this.
we have tried the following, but we are getting this error.
var ...
1
vote
0
answers
85
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 ...
1
vote
0
answers
31
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 ...
0
votes
1
answer
39
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 ...
3
votes
1
answer
35
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 ...
-1
votes
1
answer
602
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'...
4
votes
1
answer
88
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 ...
3
votes
1
answer
96
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 ...
1
vote
1
answer
49
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:\...
0
votes
2
answers
41
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 ...
3
votes
1
answer
53
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 ...
1
vote
1
answer
24
views
Seeking ArcGIS Pro equivalent to Model Iteration Properties
I am trying to make the transfer from ArcMap to ArcGIS Pro. ArcMap ModelBuilder properties had an Interation tab that would allow you to run the model multiple times with different stopping criteria. ...
7
votes
2
answers
199
views
Iterating through fields and generating formatted string output
I want to iterate through all integer type fields in a layer and generate new "display" fields marked with a 'd' at the end of the name using the appropriate field calculator expression.
The ...
0
votes
1
answer
69
views
Select by location (add to selection) is removing previous selection using ArcPy with ArcGIS Pro [closed]
I am trying to select multiple times from the same layer with different overlapping layers by location using the 'Add to selection' method. However only the last selection on that layer is kept after ...
1
vote
1
answer
36
views
Iterating and updating through feature class fields based on DataFrame using ArcPy
I am updating mismatched data across two systems and have an Excel sheet that combines a consolidated data set. Unfortunately I do not have a reliable join field to relate this back to my GIS data.
I ...
0
votes
0
answers
14
views
Iterate buffering a folder of shapefiles
I'm trying to buffer all the shapefiles in a folder by the same amount. Instead of doing each one individually, I wanted to iterate through them. However, none of the iterate options seem to work for ...
2
votes
1
answer
50
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 ...
1
vote
1
answer
99
views
Model Builder: How to iterate rasters into raster calculator
Above you can see I have a simple model in ArcGIS, when I run it, I change the ".tif" name in both sections of the calculation. I then hit OK, and it puts the new raster where it should be ...
0
votes
0
answers
36
views
Iterate a feature by expression with unique values in PyQGIS [duplicate]
Im trying to automate the process of select by expression and afterwards export it to a new layer in Qgis using Python. The Layer I'm using is called "Brutvoegel" and my goal is to get all ...
1
vote
0
answers
86
views
Iterate multiple tables for input into "Tables to Domain" tool in ArcGIS Pro ModelBuilder
I would like to iterate over multiple tables in a geodatabase then feed the tables into the "Table to Domain" tool in ArcGIS ModelBuilder.
Currently it only seems to iterate over 1 table.
I ...
4
votes
2
answers
77
views
Iterate multiple soil fields through Calculate Field
I understand this can easily be done manually using Calculate Field, however I'm looking to automate this process using ModelBuilder as it is a requirement of the current module.
I have 7 Weather ...
0
votes
0
answers
19
views
Iterating the raster calculator expression for multiple rasters (point rasters and Line rasters)
I have created a raster calculator tool which identify 5m height (elevation) either side of middle point (point is converted into raster and contain elevation value) of cross section (line is ...
2
votes
0
answers
60
views
Iterate through list with numbers (as text)
I want to iterate through a list of coordinates and see it the last coordinate matches the first coordinate. The coordinates are stored in have a GeoJSON string:
'''{"type":"...
1
vote
0
answers
55
views
PyQGIS line_locate_point
Using the field calculator I'm able to get this working fine:
line_locate_point( geometry:=geometry(get_feature('trail', 'fid', '206')), point:=$geometry)
But what I would like to do is using Python ...
1
vote
0
answers
33
views
Program works in next 30 years with QGIS over multiple layers
For an asset management plan, I want to create a table that programs work for the next 30years. For a given layer, I want to use the start date and the project into future either replacements or ...
0
votes
1
answer
51
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/...
3
votes
1
answer
85
views
Iterating and calculating with fields using PyQGIS
Inside my layer there are fields like this:
name | data | length
name_a | field_a_x | ...
name_b | field_b_x | ...
name_c | field_c_x | ...
name_d | ...
4
votes
1
answer
66
views
Defining coordinate system for every GeoDataFrame (shapefile) in list
I am looking to set a coordinate system for every GeoDataFrame in a list of them. So I need this:
gdfs[0].crs = "EPSG:6668"
gdfs[1].crs = "EPSG:6668"
And so on but iteratively. I ...
3
votes
1
answer
236
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",...
0
votes
1
answer
41
views
Batch clipping all files in folder and then save using ArcPy
I'm trying to use a script to batch clip all files in a folder, then saved with a _clipped.shp at the end of the original, I need a script that is something like this:
arcpy.env.workspace = "E:\\...
2
votes
2
answers
288
views
Iterating clipping process through list of geodataframes
I have a folder full of shapefiles, I would like to read them into geopandas and then clip them all to one boundary iteratively. I have loaded all of the shapefiles into a list with this correctly ...
6
votes
1
answer
377
views
Collect results of iterative processes in QGIS graphical modeler
I'm using QGIS graphical modeler to build an iterative process that is supposed to:
extract features from vector layer 1 (VL1) overlapping with features from vector layer 2 (VL2) (iterative per ...
2
votes
1
answer
113
views
ModelBuilder not passing information through Iterate Feature Classes using ArcGIS Pro
I am using ArcGIS Pro.
I am trying to create a model to iterate through three feature classes in a file geodatabase, all with the same schema. The model performs several joins and field calculations ...
0
votes
1
answer
33
views
Using multi iterate of ArcMap ModelBuilder
I want to use more than 2 iterates.
The data I have is point.gdb, polygon data.
There are about 2000 point.gdb.
There are about 1000 polygon data.
I want to save the points that exist in the polygon ...
0
votes
2
answers
147
views
Creating Raster to Point data using ArcMap ModelBuilder Iterate raster tool
Creating Raster to Point data using ArcGIS ModelBuilder Iterate raster
Raster material is in folder (ffaa)
Using Iterate rasters in model builder
Select folder 1 (ffaa) in step 2
Raster to point ...
0
votes
1
answer
241
views
Iterating fields using ModelBuilder in ArcGIS Pro
I am trying to combine multiple fields using the iterate fields in ArcGIS Pro ModelBuilder. I can iterate through and get the combined values but it only gives me the combination of one row, therefore ...
2
votes
1
answer
450
views
How to Iterate through files in a folder QGIS, using python
I am using QGIS 3.16, and I am trying to run the “service area from layer” function on approximately 400 layers (200,000 starting points in total), I am also due to be repeating this at a range of ...
2
votes
2
answers
708
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 ...
2
votes
1
answer
152
views
How to solve error: 'user-defined methods must return a value' in GEE?
I would like to iterate a map function over several list-of-lists.
Here is the code I run:
var feature1 = function(h) {
var FCol= ee.FeatureCollection(ee.List(losslist.get(h)).map(function(element)...
1
vote
1
answer
33
views
Clipping one shapefile file with 100 different shapefiles (Arcmap 10.1) and retrive 100 diferent outputs using ModelBuilder
I have tried without success to perform this task with ArcMap 10.1. I´m struggling with ModelBuilder.
I have one shapefile (mean precipitation in one country) and I need to clip this shapefile with ...
1
vote
0
answers
68
views
Failure to pick up attributes following use of ArcGIS Pro ModelBuilder: Iterate Feature Classes
I have a folder containing numerous point shapefiles
(Species occurrence records) and (in a separate folder) a multipolygon
shapefile of small parcels of land. For each species, I need to
extract all ...
3
votes
1
answer
196
views
Calculating final polygon after subtracting all intersecting polygons using shapely [closed]
I have a list of centroids that I buffer to 5000 meters radius. I need to take each resulting circle and run it against the remaining centroids(also buffered to 5000 m) and find the final shape after ...
2
votes
0
answers
62
views
ArcMap ModelBuilder iterate Raster and Feature Class with Raster Calculator
In our model we calculate raster datasets with the cost distance and the raster calculator. We want to multiply these with a field value from the table testbezirk. We have already tried a few things, ...
3
votes
0
answers
40
views
Calculating population within a circle excluding intersects with shapely
I have a data of a centroid and a count:
centroid population id
0 POINT(38.9081 77.0349) 9004.0 0
1 POINT(38.8521,77.0377) 517.0 1
2 POINT(38.9081 77.0377) 10369.0 ...
1
vote
0
answers
104
views
Iterating through layer using ArcPy
I'm a beginner in ArcPy and I want to perform some tasks using ArcPy but I am not getting results.
I have two layers named survey and survey selection in my current MXD. I want to create map document ...