Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [list]

Linear collection of items

0
votes
0answers
11 views

Reducing run time to extract cell values from multiband rasters? [migrated]

I have the following function and code snippet to extract cell values for multiple years, format it, and save to a list. Each raster has 365 bands -- one for each day. A separate operation is ...
0
votes
1answer
40 views

List of small lists in Python: How to retrieve items from small list in a loop?

I would like to automate the process of making some certain feature layers. I made a list of lists that goes like that: [[feature class, subtype],[feature class,subtype],...] I'd like to loop ...
1
vote
1answer
27 views

Using Python Lists in Calculate Field Code Block? [closed]

I'm looking for some help in explaining what exactly is occurring with the following code: MaterialLife = "LifeMaterial(!"+Material+"!)" codeblock2 = """def LifeMaterial(mat): material = {"ABS":...
0
votes
1answer
36 views

arcpy.da.SearchCursor storing data in a list with a query

I am currently working with a database that hold street names, x and y coordinates and many more fields. I would like, through a search cursor, to store the x,y coordinates in a separate list for ...
0
votes
1answer
26 views

Google Earth Engine: Extract rule based values from List and Array

I'm wondering how to extract values from a ee.List and ee.Array that meet a certain criteria in the Google Earth engine environment. var array1 = ee.Array([1,1,2,2,3,3,4,4]) var list1 = ee.List([1,1,...
1
vote
1answer
7 views

No visable Difference between two Lists for Visualisation via Palette creating an Error

I want to Visualize a Landcover Classification I have different success with seemingly identical Lists. List 1: Pallette Parameters inside the Code like: var landcoverPalette1 = [ 'E6004D', //...
0
votes
1answer
30 views

Selection by attribute from list

I need to select a layer with all attributes while the selection comes from a table. With my code I get only empty feature classes and emtey Excel files. The tab_list Elements are the selection value. ...
0
votes
1answer
28 views

How to load an image asset from a list of assets in the folder?

I have a folder in my Assets that contains 44 images. I want to add them to the Map in sequence. However I'm getting an error that I can only create an image that is a constant. var image = ee....
0
votes
2answers
41 views

If field 1 > field 2 update field 3 in loop

I am trying to update the table above. What I want to do is if the values in the PMP fields are less than the Max fields update the check fields with PASS, if not FAIL. I started doing this trying ...
0
votes
1answer
90 views

Earth Engine get dates from imageCollection

I try to get all acquisition dates of my ImageCollection in Google Earth Engine Code Editor. var begin = ee.Date.fromYMD(2017,1,1,'Europe/Berlin'); var end = ee.Date.fromYMD(2018,1,1,'Europe/Berlin');...
1
vote
1answer
41 views

Exporting string and float variables to ASCII file using ArcPy?

I am trying to create a script using arcpy to automate a serie of task in ArcGIS. What I am trying to do is to interpolate rainfall data from a region and then, using hydrological basinshapefiles, ...
1
vote
1answer
74 views

Creating drop-down list from dynamic field values in ModelBuilder?

I am trying to create a drop-down list containing all the values from a particular field, that I can use as an input for the Select by Attributes tool in ModelBuilder. The answer I’ve seen to ...
1
vote
1answer
309 views

Google Earth Engine, get a List of Bands

I want to Automate Band selection for all bands. Therefore a List of the Bands is needed. This didn´t work: ee.List(image.get('bands'))
0
votes
2answers
126 views

Raster operations in a raster list in R

I have a raster list (21 in total) S1 that have the same projection, resolution but not exactly the same extent. Due to this difference, I cannot stack them without solving the extent/dimensions ...
0
votes
1answer
35 views

Use two lists as input to Spatial Join in ArcPy? [closed]

I am trying to determine a method for conducting a spatial join on features from two separate feature datasets based on the first three letters of each input feature (A01_road == A01_gps). import ...
0
votes
0answers
112 views

numpy array coordinates to polyline in shapefile Python

I am calculating the shortest path in a numpy array which was converted from a raster (.tif). I have a list representing a path like [(1,3),(2,3)(3,3)]. How can I transform this into a polyline in ...
1
vote
2answers
1k views

Arrange pair of coordinates in Python lists [closed]

I have these coordinates of a bounding box in this format: (51.901071, 7.543488, 52.002215, 7.692406) and I want to convert it into a list of coordinates so that I can iterate through the pair. The ...
0
votes
0answers
117 views

Getting attribute data from a GeoJSON file

I have a JSON file that I am trying to pull specific attribute data from. Before the data is turned into a file, it is first held in a variable like this: params = {'f': 'json', 'where': '1=1', '...
1
vote
1answer
122 views

Export arcpy.ListFeatureClasses to txt for later use

I have to re-project all Feature classes of a very large .sde. In order to iterate through the whole .sde I'm using arcpy.ListFeatureClasses. Getting all Feature classes into the Feature class list ...
0
votes
2answers
95 views

Getting “TypeError: expected raster or layer name” when input is raster [closed]

I have a script that adds output rasters' paths to a list and that list is used to loop through each input in a later module. I am getting the following error: TypeError: expected raster or layer ...
2
votes
1answer
852 views

Unique List of Image Dates from Image Collection in Google Earth Engine

I would like to create a list or array object containing a unique set of dates represented in an image collection for a given region of interest. I have a function that extracts and converts dates for ...
2
votes
1answer
86 views

PyQGIS equivalent for ArcPy ListFields

I just started using PyQGIS and I am not familiar with many of the commands. In ArcPy, you can use the command arcpy.ListFields to print out the fields present in a shapefile. I'm wondering if there ...
0
votes
1answer
183 views

Listing all points in polygon geometry using arcPy [closed]

Based on my understanding in coding, I thought the following code will list all points in every feature in my Building polygon feature class: arcpy.env.workspace=r'D:\test.gdb' rows=arcpy.da....
0
votes
1answer
116 views

Getting “mismatched type for band” error in Google Earth Engine?

I have extracted a list of images from an iteration (using Google Earth Engine how can I return an image for each iteration) but I keep getting an issue when I try to add these images to an image ...
1
vote
1answer
306 views

Using SelectLayerByAttribute with list of values in ArcPy?

I'm fairly new to python, so I'm having a little trouble with this. I want to iterate through a list of values, select the list values from a feature class, select from another feature class that ...
0
votes
1answer
67 views

Creating separate list of x and y coordinates from array after using getPart?

I have an array of points by using getPart on each of the four polygons in the shapefile. I am trying to figure out a way to create a list of x and y coordinates in my for loop and name them xCoords ...
-2
votes
1answer
35 views

Converting lists into values using ArcPy?

Here is the code that I have. I run this code and it gives me the following error: "TypeError: value#1-unsupported type: list". I am having a hard time getting it to be formatted so I am attaching ...
1
vote
0answers
104 views

Filtering elements of FeatureCollection using fusion table that contains list?

I'm new to Google Earth Engine. I am trying to filter all countries in the Americas from a Fusion Table that contains all countries in the World: // Load countries var countries = ee....
3
votes
0answers
80 views

Grouping and sorting a list of equipment using an aggregate function in the print composer

I'm using QGIS as a spatial database for a construction site and we are now checking the installed equipment. The inspection requires us to have a list of the equipment ID to inspect for each type of ...
2
votes
2answers
47 views

Defining Python List of Many values

I want to iterate through a layer that has about 500 records. In my code, I'm using a definition query inside a for loop to iterate through a test list: listx = [1,2,3,4,5] My question (probably an ...
1
vote
0answers
180 views

setAttributes() with list values

In a script on PyQGIS, after a for cycle, I obtain a list like: LIST:, [[[0], 0.035, [0], [0], [0], [0], 0.036, 0.031]]) I need to put that values in the column of Shapefile Attribute Table, but I'm ...
2
votes
1answer
34 views

for list not working [closed]

I'm trying to drop the .shp from my list but when I do and print, I am only seeing the last one. When I print the list from ListFeatureClasses() I am seeing all of them. Any thoughts? Here is the ...
0
votes
1answer
38 views

Passing a Python List to GeocodeAddresses

Currently I have a list of locations, like the following: locations = ["Atlanta, GA", "Rochester, NY", "Paris, France"] I would like to geocode these locations using arcpy.geocoding....
1
vote
1answer
63 views

Why doesn't anything happen in using QgsRasterCalculator on a list?

I have a list of raster layers that I want to do a calculation on each layer with QgsRasterCalculator. My code is: lstLyr = self.readRasters() for layer in lstLyr: registry = ...
5
votes
1answer
2k views

Google Earth Engine: Extract values from FeatureCollection as list

I'm trying to extract values from a FeatureCollection as a list. Here's some example code that I'm using in Earth Engine's code editor: var viirs = ee.Image('NOAA/VIIRS/DNB/MONTHLY_V1/VCMCFG/...
3
votes
0answers
94 views

Resolve getting a sorted list when using 'getFeatures()' method

I have this code which allows to insert features in a list: liste = [] for b in layer2.getFeatures(): for a in layer1.getFeatures(): if a.geometry().intersects(b.geometry()): ...
1
vote
1answer
226 views

Sum new values to existing attribute values in PyQGIS?

I'm trying to sum new values from a list in one loop to the existing attribute values (not in a new column, but in the exiting attribute values itselfs). def radiusDivider(dist): try: itlayer = ...
2
votes
1answer
317 views

listing multiple files for a merge (arc)python

I have created a script to convert GPX into features with python. This script works but now I want to add all these separate feature classes (point features) in one featureclass/layer and convert it ...
0
votes
1answer
427 views

Leaflet routing machine Origine to destination

I want to do routing from a point to another the points are listed in legend control .the data retrieved from listbox does not work with routine machine may be because of type compatibility. var ...
1
vote
3answers
149 views

Need to get spatial data from tab-separated list into csv or similar

I am trying to download spatial data (points) from a site that offers it in two forms: a KML and a tab-separated list. Unfortunately when I download the KML file, the attributes table is basically ...
6
votes
2answers
251 views

Understanding *coords meaning when used with ArcPy?

What does *coords in the following code mean? import arcpy feature_info = [[[1, 2], [2, 4], [3, 7]], [[6, 8], [5, 7], [7, 2], [9, 5]]] features = [] for feature in feature_info: ...
1
vote
1answer
50 views

Associating a list with polygons?

I have a shapefile with different polygons (basins) and a table with a list of species indicating the polygon name where they belong. I would like to know if there is any way to associate the ...
3
votes
1answer
511 views

How to Geocode a list of address into a map in qgis?

I have a list of country and city capitol on a Excel, and I want to upload them into a map in QGIS?
0
votes
2answers
332 views

Selecting table records by attribute if in Python list

I would like to create a subset of a table based on values in a Python list that I created from a search cursor. I have not been able to get the where_clause correct and keep getting errors. Here is ...
3
votes
2answers
229 views

arcpy.ListDatasets will not read CAD files as datasets

I am essentially running this script but for my own data. The problem I am having is that the ListDatasets command is not recognizing the CAD .dwg files as datasets (as it should). It returns a 'None'...
2
votes
2answers
812 views

Adding values from list to field in feature class using ArcPy?

I have the code below. fc is a shapefile. I add a new field called "RANK". I want to populate the RANK column with values from Final_Rank list. Fortunately, they are of the same size. Field RANK has ...
0
votes
1answer
190 views

Creating a list of Rasters from another list of Rasters based on file name?

in Arcpy trying to create a subset of rasters from a list of rasters. Basically the idea, run arcpy.ListRasters on a geodatabase, check all raster names for a user input value, then add those rasters ...
0
votes
1answer
1k views

Calculate field values using arcpy.da.UpdateCursor

I am trying to create and update a field with a count of line features (tLayer) within a distance of point features (sLayer). I am attempting to use a combination of AddField_management, arcpy.da....
0
votes
2answers
45 views

Update multiple different layer data sources in mxd with multiple lists

I need to update 3 layers in a template mxd then save that mxd. It needs to loop through a fGDB and for each feature, update the three layers then save a copy for each loop. What I have loops through ...
1
vote
0answers
137 views

Remove/hide selected layer and display new layer after click on button

I´m trying to create two drop-down lists: <select id= "select1"> <option value="layer1">layer 1</option> <...