A sequence of instructions that repeats either a specified number of times or until a particular condition is met.

learn more… | top users | synonyms

2
votes
2answers
63 views

Update Cursor: Unable to populate specific field

I am attempting to create a loop to recognize the entry/exit point of a pipe to/from a structure by associating it with a North, South, East, or West direction and then populate the corresponding ...
2
votes
1answer
30 views

GRASS GIS: how to define several variables in a loop without the command locals()?

I am working on a Python script in GRASS GIS and want define several variables in a loop. My simple loop is working, but I don't know how to integrate sevaral variables. ...
1
vote
2answers
45 views

Arcpy fail to loop between files in different directories

I want to perform a loop of intersections between different files in different directories. Here is my code: Intersects = ['Name1','Name2','Name3','Name4','Name5'] #Names of my files ...
2
votes
2answers
71 views

Update Cursor for automation of tedious data entry which keeps crashing ArcMap

I coded the Update Cursor for automation of tedious data entry where I am applying a previous Survey Company Identification Data to STRUCTURES_15096.shp from "OFFICIAL_STRUCTURES2015.shp" and it keeps ...
2
votes
2answers
34 views

Use multiple attributes from table to select and merge multiple shape files

I’m totally struggling with a model build in ArcGIS 10.3. Here’s what I’d like to do. Take a table (analysis_table). Iterate over the rows in the table by a unique grouping identifier. From each ...
1
vote
1answer
42 views

How to do a Loop with a condition in Model Builder?

Can I loop a set of actions in model builder while a specific features rows are 1 or more. Some background: I have a point layer where I've created a workflow that: first selects the row with the ...
3
votes
1answer
64 views

Loop and perform loop in order depending on attribute

I have a lot of points in one layer. All of which represent the same type of real world feature. I want to perform a delete identical within XY of each point but in a specific order. (by splitting ...
0
votes
0answers
10 views

Update XYZ Source for Looping

I'm attempting to update a layer's source to create a looping effect. I've specified a custom tileUrlFunction so that the time delineation is passed in the url appropriately: source: new ...
1
vote
1answer
49 views

Arcpy get values in the 2nd field of every table in a geodatabase

I have a geodatabase in Oracle with around 50 tables. I want to get the values in the 2nd field of every table in my geodatabase. I will be using the values in the 2nd field as an input for a ...
2
votes
1answer
35 views

Optimise Search within the QGIS API

I would like to ask you about the following code, it works, but I don't think is very helpful to have elif, elif,elif... always. Then, I have to optimise it. The problem is that I can't access to ...
3
votes
1answer
156 views

Not getting correct result from for loop

The for loop below works without error, but the result is get in the table of my database is wrong. Its as if the for loop skips right over the first 3 if and elif statements and goes to the else. The ...
1
vote
1answer
36 views

While loop with Select by location (Add to selection) is not stopping

I have problem with my while loop code. It is not stopping, despite that values used to evaluated the condition to stop the loop are actually met (I can see in in my print statement). Here is the ...
2
votes
1answer
44 views

Arcpy “print” works only the first time [duplicate]

I am running this extremely simple code using the ArcGIS python environment: import arcpy test = r"C:\....\New_Shapefile.shp" #test contains several fields, including one called "Number". ...
0
votes
1answer
79 views

ArcPy Python Addin Combobox How to leave a if-loop, when selection is found

ArcPy Combobox How to leave a if-loop, when selection is found I developed a Combox which: combines values from different featurelayers the User can select an ID or activitycode (acode) the ...
3
votes
1answer
92 views

Creating Python Addin Button?

I want to create a Python AddIn button to execute a specific script. I know how to use the python addIn wizard and add the toolbar I created in my ArcMap. The trouble I am having is writing the script ...
4
votes
4answers
155 views

Get a coordinate system from raster file

I am writing a code to loop through all the files in a folder and reproject them, using a raster as the spatial reference. I have a suspicion that there is a different way to get the coordinate system ...
1
vote
1answer
37 views

Loop through a list and concatenate a string in Arcpy

I'm making a program where the user enters some codes (GetParameterAsText) that are going to be used in a SQL expression to select by atributes. I tried to find similar topics but didn't find a ...
1
vote
1answer
49 views

Spatial join for multiple shapefiles (loop)

I have the following two datasets: polygon shapefile containing administrative boundaries of a City multiple point shapefiles What I want to do is to spatially join the point shapefiles with the ...
0
votes
1answer
51 views

GDAL utility in Bash for loop (Ubuntu) [closed]

In Windows GDAL terminal (in Windows, GDAL has a specific terminal/prompt) I usually do loops and it works like a charm. What I'm trying to do the same in a Shell terminal in Ubuntu with the ...
2
votes
0answers
38 views

Extracting Mean from Raster and Writing to Table in ArcPy?

I am simply trying to extract the mean of each raster within a geodatabase and write the value to a table. I have done this successfully with another set of rasters, but now I keep getting the ...
8
votes
1answer
177 views

Simplify repetitive tasks in QGIS Graphical Modeler

Are there iterators that can be used in QGIS graphical modeler to simplify the model shown above. If not, is there any better way of simplifying the model? The first column represents my input ...
0
votes
0answers
25 views

A vector object not being replaced in temp folder when using 'for' loop in R

I am currently running GRASS GIS through R interface and got stuck at this point; where I am using a 'for' loop in R, and the code is as follows: for(i in 1:nrow(Snapped_SSP_DSN)) { ...
2
votes
2answers
77 views

ST_Distance loop

I want to create a postgresql function which calculates the distances between random points who are stored in one table. For the Table: CREATE TABLE s_1( id bigserial primary key, the_geom geometry, ...
1
vote
0answers
24 views

Trying to automate clip for multiple polygons based on unique field ID? [duplicate]

I have two feature classes, one that contains all counties for 5 states and the other contains 90 polygons I need clipped only to their pertaining county boundary, but they overlap/ cross the county ...
0
votes
0answers
28 views

Looping all features of cursor onto SQL Server feature class?

It might be me but I've been experiencing something weird. (I actually tried what suggested in this thread Arcpy MakeFeatureLayer won't loop with no luck) What I'm trying to accomplish is to use ...
1
vote
2answers
123 views

Speeding up Python code to convert multiple csv to shapefile?

I am trying to work with some crime data from https://data.police.uk/data/ The data is organised in several .csv files, one for each month and each crime is geocoded with Lat and Long. As the file ...
0
votes
1answer
25 views

Boolean If then statements in ModelBuilder and Repeating model?

I have a large, several step model that iterates through feature classes in a folder taking several time-stamped lat long points and populates several fields in the attribute table. After the model ...
1
vote
1answer
22 views

Create Separate Layers by Category

I'm trying to create a layer for each county (based on a layer of all counties) and join only those census tracts located in that county. However, the result I'm getting is a layer named for each ...
5
votes
1answer
80 views

Loop NDVI calculations for hyperspectral datacubes in R

I am writing a script for the processing of different hyperspectral datacubes. The datacubes contain flight lines that I've recorded with a UAV. In total there are 10 flight lines that need to be ...
3
votes
1answer
64 views

Finding Points in Polygons with Matching ID's?

I'm fairly new to using PyQgis, so sorry if this question is basic. I'm working with two vector layers: (layer 1) A series of polygons, each with an ID field specifying what geographic district the ...
0
votes
1answer
67 views

arcpy iterating field names, values to create new feature classes

I want to create new feature classes based on selections from a list of fields. For now I'm using a user prompt instead of GetParamatersAsText for the selection criteria. I need the script to look for ...
3
votes
1answer
167 views

Problems with nested loops - How to start from 0?

I have : 12 lines feature classes (lineFC) A polygon feature class (grid) Another polygon feature class with much bigger polygons (gridDivision) The process: Select one lines FC from a list ...
0
votes
1answer
42 views

Looping output as new input many times (50+) in ModelBuilder?

I want to run focal statistics on a raster, then run focal statistics (same configuration/setup as the first focal stat.) again on the output, and again on the new output, and again, and again. ...
0
votes
1answer
45 views

Boolean GetParameterAsText in a loop

I have this tool where the user inputs an ID number and the tool selects a list of features applies symbology (.lyr) and adds the queried features to the open mxd. # Import modules import arcpy ...
1
vote
1answer
219 views

Using Loop for calculating NDVI

I am using MOD09Q1 now and I would like to calculating NDVI whole year data. One year, I have 46 band 1 images and 46 band 2 images. list.files I creating list of band 1 and list of band 2. ...
1
vote
1answer
73 views

How do I keep my python loop going if there is an error with an SDE workspace?

I have a folder with several .SDE connections. I want my Python code to execute various SDE maintenance procedures (such as compress) on each of these databases. If there is a bad/corrupt/not ...
0
votes
1answer
232 views

Unknown Error? - A Column was specified that does not exist

shps = [(shp1,"field1"), (shp2,"field2")] for item in shps: shp = item[0] field = item[1] for row in arcpy.SearchCursor(shp, fields='"{0}"'.format(field)): if row == ...
3
votes
1answer
161 views

Loop to check multiple polygons overlap in r

I have a set of polygons (available here: http://ulozto.cz/x39ELbFt/polygons-zip) created in QGis and processed in R. I would like to know if they are overlapping or not, and if yes, where is the ...
2
votes
1answer
222 views

Loop through columns Python arcpy.ListFields

I am trying to run a Python script that loops through all fields in my input feature attribute table. I have searched extensively and tried to use arcpy.ListField to work but it seems all people got ...
1
vote
0answers
106 views

How to accelerate my python looping process for A-star path finding on DEM surface?

I try to make an A-star Path Finding program base on tile-graph (image raster data as graph) where each pixel values represent as cost and elevation.. In my case, DEM raster data was called by using ...
0
votes
1answer
119 views

How to add multiple fields to many Feature class using Arcpy

I have a geodatabase with multiple Feature Class (at least 100). I would like to add in each attribute table of each Feature Class, two new columns. I have to do that with a python script because it ...
0
votes
1answer
36 views

Using a list to access database from a layer

I am trying to access the database using a list in order to put it in a loop but I can't make it work. I want to replace the months with a list variable. This is the hard core example: ...
2
votes
2answers
100 views

Debugging Cursor object has no attribute _exit_ from ArcPy?

I am trying to replace NULL values for -999 in a table inside a gdb. I know how to replace the value for individual fields, but get an error when looping through the complete table. import arcpy fc ...
2
votes
1answer
71 views

QGIS re-write loop efficiently, assign number to every row of a column,

I have a column titled CompanyNam and I need to extract the ownership information. For example, if CEZ is the first company then, I assign to it number 1, then Sokolovska is the next number, etc. If ...
2
votes
2answers
130 views

How do I find a layer based on source name using ArcObjects?

I am relatively new at creating tools with ArcObjects and I am having trouble finding a layer based on the layer's source name by looping through all layers. I've seen here that it is possible, but I ...
0
votes
0answers
118 views

ArcGIS calculate average value

I would like to get the average value of specific attributes. I have a table with columns like: ID, P1, E1, Age1, P2, E2, Age2, P3, E3, AverageAgeP, AverageAgeE Sometimes there is a value for P, ...
0
votes
1answer
86 views

Create a Loop for Arcpy

I am looking for help to write a loop a arcpy.CalculateField_maagement process where the User is asked with the 'raw_input', prior to the tool running "Do you need to change a field value(yes/no):", ...
2
votes
1answer
49 views

Counting intersections from multiple shapefiles in counties?

I have several polygon shapefiles of counties in 6 US states. I also have three shapefiles of country-wide "impaired waterways" a line, a polgyon, and a point feature classes. What I want is a ...
1
vote
2answers
80 views

SQL query new feature with loop

I'm trying to create an individual buffer feature class for each column of an input feature class, where there is a field that contains the buffer distance. I think there is a problem with my SQL ...
2
votes
2answers
440 views

Create an array from field values in ArcPy

I have a feature class that has a field of unique ID numbers. I would like to create an array of these numbers so I can loop over them in ArcPy. Any ideas?