Questions tagged [for-loop]

A for-loop statement is a programming loop statement that performs predefined tasks while or until a predetermined condition is met.

14 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
179 views

Creating instances of QGiS in for loop in standalone python script

I have a Python script which processes data with geographic information. At some stage of my script I need to use an instance of QGiS to make some shapefiles and do some intersects and so on. For now, ...
1
vote
0answers
15 views

For-loop to call fields for IDW-Interpolation

probably a question easy to answer, but I do not figure it out at the moment. I'm using station-data and do a IDW-interpolation to get average climate values in layer. The station's data is arranged ...
1
vote
0answers
18 views

Capture non-attribute user input in ArcGIS Pro task

I am trying to write an ArcGIS Pro task that involves one or more data layers. However, the exact number of layers may vary between runs. Sometimes the data may be in one file, other times there may ...
1
vote
0answers
38 views

Using ModelBuilder to Iterate Row Selection with ArcMap?

I have a model that does a lot of linear calculations, then eventually runs into an ITERATE ROW SELECTION tool. I only want the iterator to cycle through the tools downstream of itself, but instead ...
1
vote
0answers
32 views

Loop over columns of shapefile in modelbuilder

I use a shapefile (rain.shp) with a bunch of columns (rain_1979, rain_1990, rain_1991, ..., rain_2015). I would like to transform every column of the shapefile into a different raster using the ...
1
vote
0answers
261 views

Stopping arcpy for loop in cases where outputs match wildcard and get fed back to for loop list

Using a list of the feature classes matching a wildcard, I loop through 12 feature classes with a dataset. For each feature class, I make second list of all unique values within the REGION field, and ...
1
vote
0answers
279 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 ...
0
votes
1answer
47 views

ArcPy: Excel to Table Conversion on multiple Excel files in a folder

I am trying to convert all of xls files (including single sheet) a folder into dbf tables in a gdb. Here is my code: import arcpy, os, xlrd arcpy.env.overwriteOutput = True arcpy.env.workspace = "C:...
0
votes
0answers
14 views

Using doparallel package to use multiple core for changing resolution in R

I want to use an aggregate function for my raster file to change the resolution from 30 30 to 300 300. The top code(For loop) is working very well. I want to use multiple cores to use the aggregate ...
0
votes
1answer
55 views

For loop with SearchCursor stops after first iteration

I'm trying to iteratively select and export a layer using da.SearchCursor, but the loop stops after the first iteration. Here is the code: arcpy.env.workspace = ScratchGDB # infc= "PA" field = '...
0
votes
0answers
40 views

Extract values from multiple rasters based on lookup of raster file name

I have 11 raster files (waveheightfiles), and need to extract one value from a different set of coordinates (station) for each raster. I have a list of 11 coordinates (df2) and have used part of the ...
0
votes
0answers
73 views

arcpy.Delete_management crashing ArcGIS

I'm running a for loop to rescale a bunch of rasters and then save them for use in another function. However, I'm having trouble saving the rasters properly. My current solution is to copy the rasters ...
0
votes
1answer
54 views

gdalwarp for clipping images using multiple polygon in a bash shell for loop

C:\OSGeo4W64\bin\gdalwarp.exe -dstnodata 0 -q -cutline D:\hillsborough_Images_work\split_Polygon\120-140k\Hillborough_FINAL_140000_region_IGD_120570003d29ed0dc.shp -crop_to_cutline -dstalpha -tr 0....
-1
votes
1answer
64 views

Making looping through line segments for vertex points faster?

I am trying to speed up some current code that I have for looping through lines, getting their segments and ultimately the vertex points in Python. Can anyone recommend a faster method than what I ...