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

learn more… | top users | synonyms

0
votes
1answer
28 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
32 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
140 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
24 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
63 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
23 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
18 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
86 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
20 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
20 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
60 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
54 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
53 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
122 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
39 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
38 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 ...
0
votes
1answer
141 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
59 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
195 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
119 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
147 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
65 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
89 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
35 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
67 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
58 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
97 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
89 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
70 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
41 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
69 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
284 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
33 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
45 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
71 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
52 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
110 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
128 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
134 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
125 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
55 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
183 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
368 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
80 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
446 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
361 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
123 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
56 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
57 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: ...
1
vote
3answers
965 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(): ...