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
0answers
24 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
14 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
1answer
69 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
65 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
35 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
92 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
29 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
24 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
37 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
62 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
64 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? ...
1
vote
1answer
116 views

Create a fishnet in a 'for' loop with Arcpy

When running the following script, I get the error saying that I need a value for “origin_coord” and for “y_axis_coord”. So is it not enough to define a template dataset? But how can I fill the ...
2
votes
2answers
75 views

Batch Conditional Test - For Loop with a Group of Rasters

Edit: Question was answered. Please scroll to see fixed script. Thank you everyone who helped! How do I ask a “for loop” to operate on groups of three files folder (e.x. files A, B, C), then files ...
2
votes
1answer
120 views

How to add buttons to QT ui for qgis feature forms to loop through attributes?

I'm looking for a bit of guidance. I'm happy creating a standard feature form using QT designer (as excellently documented here) for QGIS but I was wondering how you add a forward and back button to ...
2
votes
2answers
63 views

Reclassify a rasterList and sum the reclassified value from each Pixel

I'm trying to write a script in arcpy which reclassified a List of Rasters. This rasters are made by another tool before so there is already a loop. Actually I get the error 000582 and before this ...
1
vote
2answers
61 views

Create a table with open() in a loop using the SearchCursor and InsertCursor

I like to create a table with open() in a loop using the SearchCursor and InsertCursor, but I don't know how. Before I used a few geoprocessing tools to get a field for percent. The Attributtable of ...
0
votes
0answers
69 views

Python + GME (Spatial Ecology) + Subprocess.call

I'm trying to run the following code to use GME commands in Python. import arcpy,os,subprocess from arcpy import env env.workspace=r"D:\Users\myname\Desktop\aviso" count=0 for raster in (f for f in ...
2
votes
3answers
294 views

Loop with arcpy.ListFiles

I'm super new on here and have also not much experience with Python but I really like to learn to work with this language. I'm tying to write a script for this: I think I need a for loop instead ...
2
votes
1answer
103 views

How to do loops on raster cells with python console in QGIS?

I'm new here and beginner with python. I'm looking for a solution to my problem for some hours but now you are my last chance... I'm using the python (2.7.5) console in QGIS (2.4.0). Is there a ...
3
votes
3answers
231 views

Loop in ModelBuilder for compositing bands of multiple Images

I'm attempting to automate the "Composite Bands" tool somehow in ModelBuilder, but haven't been able to figure out an effective method. I have landsat 7 data that is separated into folders and each ...
0
votes
1answer
178 views

Getting error 'exceptions.NameError' in Python script?

I'm getting <type 'exceptions.NameError'>: name 'B' is not defined when I run this script. Why is my 'B' not defined and is it a syntax error? For clarification, I am trying to get the code to ...
2
votes
1answer
85 views

forLoop & joinField & different names

I have a folder with an output (shapefiles) from an iteration. On this output, I want to perform a join between two attributetables. So far so good. Here comes the tricky part. There are different ...
2
votes
2answers
82 views

Call field from zip() into Field Calculator expression ArcGIS

I've been trying to find a way to call in field names from a zip(). Basically I have 12 fields called "Flw_days1", "Flw_days2" etc and corresponding "Depth" fields that need to be calculated using the ...
0
votes
1answer
34 views

Interaction with two variables as parameters, saving the raster properties output into a table (.dbf)

The draft of the model below TASK: I need to calculate the percentage of river channel that is covered with shadow in each timestep RESOURCS: I have values for azimuth and elevation of the sun ...
0
votes
1answer
65 views

excluding NaN records from FOR loop?

I am trying to create an array of Z and M values for vertices from a polyline (Z and M enabled) feature class. Some of the vertices do no have M values/geometry and I wish to exclude them from the ...
0
votes
0answers
45 views

How can I define coordinate system of feature class when overlaying with coordinate zone shapes in python?

I have generated bounding boxes for CAD drawings that do not have defined coordinate system files. I know that each drawing could be in one of 6 different systems that do not overlap. My idea was to ...
0
votes
1answer
43 views

Creating a loop for Lines data (spatial data)

I am trying to build a lines shapefile with the contour lines from the 20 meters isobath from along the East African coast. This contour line of 20 meters has different segments and I have this ...
0
votes
1answer
60 views

Splitting the job on Arcpy SearchCursor

I'm running a for loop with a cursor to disaggregate a large feature class into many smaller ones (of one polygon each). ArcMap crashes after about 1100 iterations, and I am trying to break the job ...
0
votes
2answers
51 views

If clause within if clause VBA Arcgis10

I'm using ArcGIS10. I do not know what's wrong with this VBA code in the Field Calculator: *All the fields are String type If [StartY] < [EndY] Then If [DOT_OSM] ="1" Then Output = "F" ...
0
votes
0answers
59 views

Assigning a changing value to a variable in ArcMap using Python

I have two lists/strings/sets (the exact format can easily be changed) of values (u and v). I would like to do a cost distance analysis between each point in u and all points in v. For this, I need to ...
0
votes
0answers
20 views

extracting values from maps and inserting into a summary table

I have several maps that I am working with. I want to extract the values (1, 0 and NA) from the maps and place them all into a summary matrix. Since I have so many maps, I think its best to do this as ...
2
votes
2answers
200 views

Nested loops for raster calculation arcpy

I am trying to figure out a way to input corresponding raster datasets from two separate folders into an equation using arcpy. I think it requires some sort of nested loop but I can't figure out how ...
0
votes
2answers
60 views

GRASS GIS using a loop with r.neighbors command

I'd like to do a trend analysis with ndvi data from 1982 til 2005. I am using the r.neighbors command to get first the spatial variance (then I would use r.series method=slope to get the actual trend) ...
0
votes
0answers
42 views

How to crop an image into more than 80 small sections automatically in R

I'd like to crop an image into 15 sections in R. The image projection is Geog lat/long, extending 87 to 120 degree in East and 45 to 55 degree in North. I want to separate it by every 2 degree. So I ...
1
vote
1answer
66 views

How to loop qgis:zonalstatistics using Python?

I'm looking for some Python + QGIS foo for the following: import processing for i in range (1,20): processing.runalg("qgis:zonalstatistics", "/folder/input/raster.tif",%i, ...
0
votes
1answer
66 views

Scripting a Loop of Clip (Analysis)

I wish to loop function that clips a shapefile by a feature class. I want to make the clip the same as the input name. The names of the files are WVHGT_201403281200_f180_201404050000.shp and I just ...
0
votes
1answer
96 views

MapBasic For Loop ignoring every other row

I have made a loop in MapBasic but is it only updating every other row in the table: My code works from the bottom of the table upwards to generate start and end coordinates for polyline features: ...
3
votes
1answer
57 views

Keeping the Highest Valued polygon

I have a single polygon feature class that contains large polygons which represent signal strength. Often times these polygons overlap. I dissolve to get multi-part polygons with a value range of 3 ...
2
votes
1answer
100 views

Map algebra for loop

I have never coded in Python before and I am trying to loop a simple map algebra equation across 365 rasters. I am trying to calculate total water flow over cells but in the raster I have a negative ...
0
votes
1answer
86 views

Using MakeFeatureLayer to select by location in arcpy

I'm trying to assign a state plane zone based on if a point intersects it. I make a feature layer from a feature class. It gets through the loop once and calculates everything correctly, but when it ...
-1
votes
1answer
734 views

How to create a loop in R to average ndvi raster time series?

I have monthly ndvi raster geotiffs for multiple years. I need to run a loop to get the average of each of these ndvi grids/rasters. Each of my ndvi rasters contains 143 pixels. I would like the ...
1
vote
1answer
248 views

Multiply a raster list with a field value list in a FOR loop in ArcPy

I'm trying to create a simple map algebra calculation not managed by ModelBuilder, but writing it in Python is trickier than I thought. I have a list of raster in a GDB and I must multiply them by ...
0
votes
1answer
187 views

How to create a loop for multiple points with cost distance / cost path in ArcGIS 10.2 in python

I would like to know how to simplify the following code in order to execute it more efficiently than copy paste 82 processes (with a loop I guess?) but I don't know how to do it. There are 4 main ...
1
vote
1answer
325 views

Out of memory when calculating loop in ArcGIS 10.2 with Python 2.7

I am quite new to scripting for ArcGIS, so don't mind the styling and layout. I am trying to calculate 600.000 routes by looping a network analyst route analysis. The script extracts two pointID's ...
1
vote
1answer
411 views

add unique IDs to mutiple polygons using loop or apply function

I want to add a unique ID (row number) for each polygon in a SpatialPolygonsDataFrame. I'm new at working with spatial data (and programming) so bear with me please. The goal is to merge all polygons ...
2
votes
1answer
74 views

Mystery duplicate values

I'm using a unique list to populate up to 10 fields for a fc with correct geometry, in an "overloading" manner as you would in excel. I noticed on my first run through I had an "index out of range" ...
0
votes
1answer
175 views

R for loops in Geospatial modelling environment

I am using the isectpolypoly command in GME and would like to iterate over several polygons ("proj_0_ect0207", "proj_1_ect0207"). My code is as follows: for (i in 0:30) { ...
2
votes
2answers
266 views

Error when looping Polygon to Raster with python through different fields ArcGIS 10

This is the first time I have posted a question on here so please have some patience! I've been trying to create a python script to loop through numerous shapefiles converting various fields to raster ...
2
votes
2answers
164 views

Python-OGR: nested loop only loops once

I have a polygon file buffer_stands.shp with 20 features and I have a line file OSMroads.geojson with 9 features. I expected the script to loop through the buffers and print out for each buffer loop ...
1
vote
2answers
887 views

How to access each raster in a stack with a loop

I have a stack of rasters and I want to access each layer, combine each later with another file and finally export the resulting file as a csv file. Is there any way to do this with a loop? So far I ...