Questions tagged [loop]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
26 views

joinbylocationsummary with loop on the same input layer using PyQGIS

I have adapted a script to use "qgis:joinbylocationsummary" in a loop. I would like to adapt it so the loop adds all the .shp of the directory 'layers_I_want_to_add' to join their maximum to ...
user avatar
1 vote
1 answer
26 views

Optimal workflow for automating placing points that represent clusters (between QGIS, FME, Python)

Ultimately I would like to automate the process of generating clusters from points (representing buildings and amenities within a neighbourhood), and placing points at street intersections which are ...
user avatar
1 vote
0 answers
81 views

QGIS Python script crash when looping many times (memory problem?)

I'm having trouble with a part of a Python code that does many iterations (about 5000). The problem found is that the program crashes, it returns an error (sometimes memory error, other times all QGI ...
user avatar
  • 21
0 votes
1 answer
45 views

Loop chapter with map

I need to create a document to show the interventions done in different neighborhoods, I´d like to do it on a loop as the maps are all the same, except with different shapefiles that are named the ...
user avatar
0 votes
0 answers
43 views

Python script to turn off a checkbox in all layers in ArcGIS Desktop

I need to remove the check for all the layers on a map that has the "UT Simbology" check. I am not really sure If I could use update layer because this is an extension developed by a GIS ...
user avatar
  • 21
0 votes
0 answers
40 views

PyQGIS actions does not work for second half of the loop

I have a folder with 1600 subfolders. I've developed an script to merge two shapefiles from each subfolder and store the result in the same subfolder. I ran the script and it worked well. However, ...
user avatar
0 votes
1 answer
75 views

ArcPy Spatial Join Loop use the output layer as the target feature

I am trying to generate a script that executes a Spatial Join between specific shapefiles. However the only values that are added to the result feature are the first and last in the list of shapefiles ...
user avatar
  • 93
0 votes
0 answers
30 views

Create the loop for multiple raster convert to vector polygon using the arcpy scripting tool

This is my code which works only with the one raster image. But I need to create the tool that converts the multiple raster to vector in loop with arcpy. import arcpy from arcpy.sa import * arcpy.env....
user avatar
2 votes
1 answer
61 views

Raster calculation with conditions in R

I have two rasters (A,B) with the same resolution, extent and crs. Now I would like to generate a raster C with the value 1 for each cell that have a value of 30 or higher in A and B. I use a loop, ...
user avatar
  • 99
0 votes
0 answers
156 views

How to multiply one NetCDF file to multiple NetCDF files

I have one NetCDF file (region.nc) that I want to multiply to multiple NetCDF files such as the one in the picture using -mul from CDO.: The output should be new NetCDF files resulting from the ...
user avatar
  • 13
2 votes
1 answer
51 views

Using ArcPy to iterate feature classes for kriging

I have 12 feature classes and they are named from net_0 to net_11 but the order of feature classes In Arc catalog is,List_wells = [net_0,net_1,net_10,net_11,net_2,net_3,net_4,net_5,..net_9]. I used ...
user avatar
  • 23
1 vote
1 answer
46 views

Raster Calculation through two iterative loops in R

Here is a list of files I would like to create a loop with for a raster calculation "J:\NAIP\temp5\m_4208902_nw_16_1m3m_sd.tif" "J:\NAIP\temp5\m_4208902_nw_16_3m_sd.tif" "J:\...
user avatar
  • 67
4 votes
1 answer
109 views

Comparing polygons from zip lists inside a loop, whose data comes from user in Python

I have made a program that calculates area and perimeter based on 2D coordinates (latitude and latitude) given by the user, asking if they want to include more coordinates from the third pair, and ...
user avatar
4 votes
1 answer
92 views

Printing zip lists whose data comes from input user in a loop

Printing zip lists whose data comes from input user in a loop I have made a program that calculates area and perimeter based on 2D coordinates (latitude and latitude) given by the user, asking if they ...
user avatar
1 vote
0 answers
93 views

NetCDF in QGIS --constructing time series using 1368 bands

I have the NetCDF file that contains monthly gridded temperature from 1900 to 2014 (air.mon.mean.v501.nc). The goal is to extract monthly time series for every polygon in my shapefile. Using the US ...
user avatar
  • 11
1 vote
0 answers
238 views

Export images by loop function in Google Earth Engine (error: invalid JSON)

I want to export data from the FireCCI V51 product in GEE using a loop function for the years 2001 - 2016 for my studyarea. However, when running the code, the error "invalid JSON" appears. ...
user avatar
  • 11
2 votes
1 answer
49 views

Iterating through attribute in layer to create new layers

I am working on the school project in QGIS, in which I have Price map of the buildings in a vector layer. Each polygon has its price attribute. The maximal value of price is 20 000. I would like to ...
user avatar
  • 63
1 vote
0 answers
46 views

Creating NDVI tiles from NAIP tiles in R Loop

I have a folder with many 4 band NAIP .tif tiles, band 1 = Red, band 4 = NIR. In R I would like to create/calculate unsigned 8-bit NDVI images for each of the tiles in a folder. I would like to write ...
user avatar
  • 67
0 votes
1 answer
91 views

Custom Portal GP Service fails for unexplained reason [closed]

I have written a script to create a smoke plume from user inputs (it draws a giant triangle) and then update a number of structure features that are touched by the smoke plume. It works in ArcMap, but ...
user avatar
  • 11
1 vote
0 answers
44 views

Use ModelBuilder to project rasters from 600 folders into subfolders in each folder [closed]

I have 600 folders, each folder contains a raster (IMG) and I want to project each raster from one coordinate system to another and generate new folder in the source folder to contain the projected ...
user avatar
0 votes
1 answer
49 views

Google Earth Engine: Sampling through image collection [closed]

I am trying to get samples from each image in an image collection and merge them into a single feature collection. So, I wrote the following code (https://code.earthengine.google.com/...
user avatar
8 votes
1 answer
144 views

Creating multiple buffers in a loop in GEE

I would like to do 50 buffers from a known point. I know to do one by one, but I would like to do in a Loop. Is there any way to do it? This is part of my code: var buff1 = ee.Geometry.Point([-46....
user avatar
0 votes
2 answers
41 views

Getting SyntaxError when trying to loop through shapefiles in folder, calculate Euclidean distance and save files with appended name using ArcPy

I want to loop through shapefiles in a folder, calculate Euclidean distance and then save the files in an output folder with an appended name in arcpy. I want the name to be the filename with "...
user avatar
  • 413
0 votes
1 answer
102 views

Loop Issue: Extracting mean temps for each layer of RasterStack (NetCDF File)

I am running into a little bit of a problem with a RasterStack loop. I am trying to extract the mean temperature for each county in North Carolina for each hour over the last 10 years. I am able to ...
user avatar
  • 1
1 vote
2 answers
48 views

ArcPy.da.SearchCursor not cursor-ing

I am using ArcMap 10.8.1. I have shapefiles that are a series of overlapping polygons of drone imagery footprints. I want to loop through each shapefile, and for every shapefile loop through and ...
user avatar
  • 613
1 vote
0 answers
64 views

Loop through folder and join pairs of files with the same prefix

I have two sets of shapefiles that I would like to join based on a similar field. They are all stored in a path folder which is stored as the variable "steps". One group of shapefiles are ...
user avatar
  • 613
3 votes
1 answer
228 views

Iteration over features in PyQGIS processing modules

I have an issue with processing.run commands where I would like to do an iteration over features in a layer with polygons. zsj = QgsVectorLayer("/data/grassmaster/testVlado/zsj_ba_test.gpkg",...
user avatar
  • 31
0 votes
1 answer
225 views

How to apply cdo mask command to loop over multiple .nc files in Python?

I want to use the cdo command for masking the .nc file (the command below): cdo div input.nc maskfile.nc outputfile.nc The command above should be applied over multiple .nc files (looping) in python, ...
user avatar
  • 13
0 votes
4 answers
314 views

Changing extent of raster in loop using R

I have raster objects of a certain extent (0, 360, -90, 90) and I want to change that extent for all of them to a different extent (-180, 180, -90, 90). The thing is that I have my objects (raster ...
user avatar
  • 3
4 votes
1 answer
316 views

Using PostGIS to find the overall difference between two (large) polygon datasets

I need to get the Difference of an input layer with ~30k polygons and an overlay layer with ~500k polygons (of which ~200k intersect the input layer). I am trying to learn PostGIS to do this, as it ...
user avatar
  • 155
1 vote
0 answers
117 views

GEE: How to iterate through a feature collection to calculate annual average indices from MODIS for each feature

I am trying to calculate the average annual vegetation condition index from MODIS data for a set of raions (districts) for spring months (march, april and may). I am wanting to export this data to a ...
user avatar
  • 715
2 votes
2 answers
88 views

Getting names and numbers in specific vectors from a dataframe in a loop R

I have a huge DataFrame, in which I need to extract some information that generates filenames that I need to search in my working directory later, I also need the value in each cell of the pixel ...
user avatar
2 votes
2 answers
692 views

Iterating over dates to extract precipitation in Google Earth Engine

I'm looking to sum precipitation for a period of 10-days prior to a specified date. This is just an example - in fact, I have around 60 different dates and I don't want to select each the date ...
user avatar
  • 23
0 votes
2 answers
638 views

Loop through coordinates, adding a marker to the map for each using HERE maps

I am trying to add a number of markers to my map, using HERE maps API. I have my coordinates in a list, and there are 30+ pairs. var coords = [[60.1697768639186, 24.82923586371288], [60....
user avatar
  • 313
1 vote
1 answer
117 views

Loop for cropping, cloud masking Sentinel 2 L2A images

I have 6 stacks Sentinel 2 images (10m resolution) that I want to crop to my AOI and cloud masking. After which I want to calculate NDVI in R. The stacks are 3 from different months of 2016 and 3 from ...
user avatar
3 votes
1 answer
508 views

How to loop through each feature in a shapefile in Google Earth Engine?

I have written a script which calculates the mean NDVI, NDWI, and NDDI (Normalized Difference Drought Index) values for a given county in a specified time period. These values are then outputted to a ...
user avatar
  • 31
0 votes
0 answers
79 views

Creating plots for each hour of each day with Python

I am trying to create an animated map (by generating multiple plots) of road traffic throughout a week, where the thickness of roads is represented by the volume of traffic at a specific time of day. ...
user avatar
2 votes
2 answers
155 views

Writing PyQGIS script with operations on multiple set of rasters

I would like to perform a loop that takes from a given folder a set of rasters and for every raster makes the following operation, that in the specific case is the calculation of the monthly ...
user avatar
  • 165
3 votes
1 answer
166 views

Conditional statement in R based on multiple rasters

I have: raster_1: an integer raster with non-sequential values i (101, 130, 240, 323) i: a watershed discharging X of sediment in the environment raster_2: represents the water quality for each ...
user avatar
  • 31
3 votes
1 answer
281 views

Error when calculating final polygon after subtracting all intersecting polygons using shapely

This question is a follow-on question from Calculating final polygon after subtracting all intersecting polygons using shapely which was answered. I have a list of centroids that I buffer to 5000 ...
user avatar
3 votes
1 answer
193 views

Calculating final polygon after subtracting all intersecting polygons using shapely [closed]

I have a list of centroids that I buffer to 5000 meters radius. I need to take each resulting circle and run it against the remaining centroids(also buffered to 5000 m) and find the final shape after ...
user avatar
8 votes
2 answers
217 views

Looping with a range of integers for 'numeric' inputs in QGIS Python Console

I have been trying to run r.sun.incidout in a loop of integers (for the 'Day' option, type=integer) in QGIS Python Console. Since the 'day' parameter takes an integer number for its value, I get the ...
user avatar
1 vote
0 answers
69 views

Loop does not run in QGIS action

I tried to create a QGIS action in order to refresh several materialized views at once. for that I wanted to execute a simple loop in my action in order to recover the database where the view will be ...
user avatar
1 vote
1 answer
372 views

Invalid Number Error in Google Earth Engine?

I wrote the below code for sentinel5 data, but returns Invalid Number error in monthly loop. It used to work very well but now shows error. How can I fix it? code link: https://code.earthengine....
user avatar
0 votes
1 answer
160 views

Google earth engine: function to apply code to sequential dates

0 I have a code which creates a value for several different variables for a specific time period (usually over 1 month) and exports these as a csv to my google drive. You can find a link to the code ...
user avatar
0 votes
1 answer
699 views

Execute loop in PostgreSQL query

How to execute for each table in the list one fixed query replacing just %table% in PostgreSQL (like variables and loops) sql = 'select * from $table$ where...some_filter' $table = {tb1, tb2, tb3...}...
user avatar
1 vote
1 answer
85 views

Is there any fast looping through too many shapefiles in a folder using ArcPy?

Looping through shapefile using arcpy.ListFeatureClasses() is very slow for many shapefiles. because first thing first, it writes all in memory as a list and then read each shapefile one by one. Is ...
user avatar
1 vote
1 answer
112 views

Loop through directories and mosaic all raster TIFFs in each dir

I have 200+ directories, each directory contains x amount of TIFFs which I want to mosaic. I have a snip of code that will list the TIFF contents of all dirs under a parent directory, now I just need ...
user avatar
  • 21
0 votes
1 answer
846 views

Remove Images from Image Collection in Google Earth Engine?

In the below code, I'm going to remove some images from image collection by if condition in .map() instead of filter.neq(), what should I do for this purpose? Map.centerObject(table); Map.addLayer(...
user avatar
3 votes
2 answers
213 views

How QGIS Python loop through all tables MS SQL Server?

I've got Python code on QGIS 3.12 that adds a MS SQL Server data layer to the map, but I need to add all of them. uri = QgsDataSourceUri() uri.setConnection(r"xx.xxx.xxx.xx\xxx", "xxxx&...
user avatar

1
2 3 4 5
7