Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
28 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....
2
votes
0answers
162 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
26 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
25 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
256 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
229 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
0answers
26 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
30 views

Using dictionary key values in for loop for dynamic output variable assignment in Arcpy

I am wondering why I need to include a '/' at the end of my path name when changing my workspace. I am writing a script where I'm trying to create a geodatabase and then reassign my workspace to it. ...
0
votes
0answers
37 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
0answers
29 views

Applying Various Symbologies in Loop

The code runs, but the output layers do not display the symbology layer(s). Any suggestions? def Copy_Symbology( Symbology_Template , Input_SHP , Output_Layer_Directory ): baseName = os.path....