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

learn more… | top users | synonyms

1
vote
1answer
32 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
40 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 == ...
1
vote
1answer
41 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
59 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
23 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
39 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
34 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
39 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
48 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 ...
1
vote
2answers
47 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
41 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
58 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
34 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
55 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 ...
1
vote
2answers
112 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?
1
vote
0answers
28 views

Loop to increase value on Parameter of Model?

I'm working on the ArcGIS Model Builder to develop a model that makes a Raster Calculation using a Value Parameter and analyzes the maximum pixel value of the result, comparing to a Reference Value. ...
0
votes
0answers
73 views

Error in python code for map automation (loop)

I try to make this code work but I cannot find the error (not very familiar with python) The code should basically run through a file GDB where all the feature classes are stored. It then should ...
0
votes
0answers
29 views

Creating a for.loop to randomly extract data from a raster stack within shapefile extents

I'm currently comparing a MODIS time series of about 15 years to determine the effects of pasture management practices on the "greeness" of pastures in a water catchment. So far I've been able to ...
3
votes
1answer
59 views

fTool in pyqgis: Is it possible?

I am doing a work which I need to sample random points for many layers (classification of land use). Then, I'm trying to do a loop with my several layers and applied a functions of random pointos. I ...
0
votes
1answer
44 views

Loop through table, look for word in text field, set boolean true if word exists

I want to create a function that loops through a table and checks if a specific word exists in a text field. If it does, the function should set a Boolean field true. This is what I've come up with. I ...
0
votes
1answer
57 views

Add Polygons to SpatialPolygons via loop / iteration using R?

Just out of interest: I'm creating a SpatialPolygon (R with package "sp") with a number of Polygons within. Is there a way to loop this task? I'm doing it manually as follows. The Polygons consist of ...
1
vote
2answers
76 views

How can I loop through a list to create rasters and write them to .tif files?

I received 3 .mat files that each contain several daily maps. I need to take them and get them into ArcMap (10.2 if that matters) as a .tif with spatial information. I have already used the R.matlab ...
1
vote
2answers
84 views

How to assign a unique ID to groups of items in the attribute table in ArcMap?

Using arcmap's field calculator I need to programatically loop through all of the entries in the field and for each name it gets its own unique id. So names that are the same would get the same ...
2
votes
1answer
71 views

Using a for loop to execute a query in arcpy

I'm trying to provide the breakdown of fire detection for an area by sorting of confidence levels. The dataset has 12 files (one for each month in a year) with fire records which all have a column ...
1
vote
1answer
37 views

Iterative Mean of Means Infinite Loop for calculating H-t Index

I'm trying to create a function that will calculate an Ht-Index for Quantifying the Fractal or Scaling Structure of Geographic Features (but am new to R) which basically just finds nested means of ...
1
vote
0answers
108 views

While loop in QGIS modeler

I am looking for a way in QGIS - preferably using the graphical modeler but console scripting will also do - to build a model that iterates through features of a given layer until a condition is met - ...
1
vote
2answers
185 views

Using Python to export multiple layers to .pdfs

I have found a solution to the issue below. The problem had to do with coding GetParameterAsText without actually using it as an input in a tool. That was the reason the raster layers wouldn't turn ...
0
votes
2answers
67 views

How can i create points per 10 and 100 meters for several lines with ArcPy?

I have 10 lines and i want to generate points per 10 and 100 meters for each one of them. In ArcGis there is the tool construct points(COGO) but is not scriptable. Is there any suggestion? Also i ...
1
vote
1answer
183 views

Looping through Layers, Add Layer to MXD, Export Image, Repeat, using ArcPy?

ArcGIS 10.2.2 I am trying to loop through a list of layers in a folder, add each layer to an mxd and export an image of the added layer. I have added arcpy.mapping.RemoveLayer to the script to remove ...
3
votes
0answers
173 views

How to stop a PyQGIS script that has an infinite loop, using the keyboard?

So i wrote a script that does what i want over and over again using a "while True:" in a certain time interval (every 5 seconds using time.sleep(5)). So far so good BUT when i want to stop it i just ...
-1
votes
1answer
80 views

Same Sector Created in Mapinfo Help

The PRACH data is saved into a tab and then moved into another tab file "ToUpdate" Select * from PRACH_data where Obj into ToUpdate Fetch First From ToUpdate Do While Not EOT(ToUpdate) circ = ...
2
votes
1answer
44 views

Looping for importing and interpolating a lot of LIDAR files?

I'm quite new to Grass Gis and I'm trying to make DEM (digital elevation model) for modelling flooding. I have 170 *.xyz files, which need to be scanned for extents (r.in.xyz -s input=...\filename.xyz ...
1
vote
0answers
41 views

JavaScript _.each function not showing correctly [closed]

Can't seem to get this to display the correct way. The correct way would be Day/open/hours. geojson displayed below: hours: { monday: { close: "18:00:00", open: "10:00:00", call: ...
0
votes
1answer
219 views

Error in python code for loop using SearchCursor, selectlayerbyattribute, and copyfeatures tools

I am fairly new to python scripting for ArcGIS. I am trying to create maps where each county is selected and then copied into a new layer with only that county's data. Then, I used ApplySymbologyFrom ...
1
vote
3answers
457 views

Extract numbers from string field

I am trying to calculate field test2 with only the numeric values from a string field test. The entire script is like: def makestr(test) list=[] for s in test: if s.isdigit(): ...
1
vote
0answers
77 views

Eliminate in Arcpy

I am attempting to move away from Coverages. One of the tools we have did a great job of eliminating slivers from our datasets based on hard and soft boundaries for elimination rulesets; howver, it is ...
1
vote
1answer
74 views

Order/Sorting of Iterate Field Values (ModelBuilder)

I am using Iterate Field Values to Iterate my Model through a list of Strings (DBF-File). However, the Field Values-Iterator will always sort my Field by alphabet (ascending). It does not matter how ...
0
votes
1answer
113 views

For loops + boxplot for raster

I have several Rasterstacks (b1_mask, b2_mask,...) of several layers representing only a determined pixel-intensity range. (So point "A" in some layers is "NA" - in others a "value" of that certain ...
1
vote
1answer
50 views

How to fix this “Sorry <1> is not a valid option” in GRASS-Ubuntu using r.water.outlet?

I am working with this .sh code (a while loop, extracted from: http://www.surfaces.co.il/) to create watersheds from drainage raster and outlet point of every watershed, but I obtain this error: ...
2
votes
0answers
79 views

Looping a location-allocation problem in ArcMap's Model Builder

I have developed the model below in which I iterate through a series of values for a variable in the Location-Allocation type of problem. The variable is the number of facilities to solve. The model ...
2
votes
0answers
70 views

GRASS 6.4.4 vector command in crashes QGIS 2.4 (g.gisenv.exe has stopped working)

I am running Windows 8.1 64 bit, and have QGIS 2.4 and 2.6 installed. When I try to use a GRASS 6.4.4 vector command (specifically v.clean), I receive an error message in an endless loop, and the only ...
1
vote
2answers
133 views

Use row as input to other processes in python

I am new to python and need help. Looked for my answer but don't know if I am even using the correct terminology. I have a model in which I iterated through rows and performed a set of processes on ...
2
votes
3answers
93 views

Arcpy: Processing multiple files subsequently

I have an indexed dictionary containing files and want to "mosaic" (arcpy.MosaicToNewRaster_management) all files with the same index. The number of files per index range from 1 to about 30. ...
1
vote
1answer
150 views

GRASS scripting for producing multi-band raster

I am trying to loop the r.sun function within a Python script. Anyway, I seem not to understand how I can stack the raster maps each loop would produce into a single multi-band raster (preferably in ...
1
vote
1answer
444 views

ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Layer Name or Table View: Dataset L does not exist

Hi I am trying to create a loop so that each layer is produced in its own map. This is my code: import arcpy path = "C:\Users\Et\Documents\ArcGIS\Default.gdb" mxd=arcpy.mapping.MapDocument(path ...
0
votes
2answers
65 views

Con function loop doesn't calculate for all the fifty rasters in a list

I have been trying this for hours and I know it should be easy but I can't make it work yet. I have a list of 50 rasters that I need to change the NoData to "0" values. I have the right arcpy ...
1
vote
0answers
39 views

label based on related features

Esri's telecom data model has 2 geometric networks, one for infrastructure (manholes and conduits) and one for fiber cables. fiber cables are easily related to a section of conduit based on existing ...
1
vote
1answer
117 views

Using query in a while loop causing android application to freeze

I am having some troubles with the while loop + query. What I'm trying to do is track the user location (using onlocationChanged) and keep querying a FeatureLayer until the query returns a result and ...
0
votes
2answers
161 views

Problem with Bash loop in GRASS GIS

I'm new to GRASS GIS and programming and I'm running into a lot of what I imagine are beginners problems and something similar to this has been asked before, but not In a way that I understand. I'm ...
2
votes
1answer
108 views

Exporting layout elements and constants to Python script?

Is it possible to export the elements and constants used in a layout to a Python script? Something similar to creating a model and exporting it to Python but instead of being a model, it's a layout? ...