Questions tagged [list]

Linear collection of items

Filter by
Sorted by
Tagged with
16 votes
2 answers
21k views

Getting list of layer names using PyQGIS [duplicate]

I need a list containing the names of all the layers in a QGIS session. I did the task as layersNames = [] for i in self.iface.mapCanvas().layers(): layersNames.append(str(i.name())) but this has ...
jgpallero's user avatar
  • 749
30 votes
8 answers
27k views

Getting list of distinct values from shapefile field using QGIS

I have a shapefile whose features I can filter by specifying a where clause in the query dialogue. F.x. I have a field named "city_name" and by stating "city_name" = 'London' in ...
Raffael's user avatar
  • 530
10 votes
3 answers
14k views

Getting attributes of selected features using PyQGIS

Could anybody provide an example how to get the attributes of selected features? I tried the following code in the Python Console : but I'm stuck at the point where I'd like to get the attributes: ...
dimpflmoser's user avatar
6 votes
1 answer
3k views

Getting list of layers names using PyQGIS

To get the list of TOC layer names I used the approach suggested here: for layer in QgsMapLayerRegistry.instance().mapLayers().values(): print layer.name() But this method is not reliable due to ...
SS_Rebelious's user avatar
  • 5,621
7 votes
1 answer
7k 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/...
Rob Marty's user avatar
  • 369
3 votes
1 answer
615 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 ...
N.McFadden's user avatar
3 votes
1 answer
1k views

Field list in combobox in pyqgis

I'm new to pyqgis and I'm tryig to make a combobox with list of fields (from layer also selected in combobox). layers = self.iface.legendInterface().layers() layer_list = [] for layer in ...
W. Tom's user avatar
  • 668
1 vote
1 answer
511 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 = ...
Nico's user avatar
  • 317
10 votes
6 answers
3k views

Is there a faster way in python of finding the smallest number in a field?

Using arcgis desktop 10.3.1 I have a script which uses a search cursor to append values to a list and then use min() to find the smallest integer. The variable is then used in a script. The Feature ...
Robert Buckley's user avatar
10 votes
1 answer
3k views

Listing project layers in standalone PyQGIS script

I'm trying to load an existing .qgs project and get a list of the layers inside. I seem to be able to open the project, but I can't get the list of layers. I'm a little confused as to the basic PyQGIS ...
KJYDavis's user avatar
  • 693
7 votes
2 answers
490 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: ...
user100316's user avatar
6 votes
2 answers
298 views

Writing list as attribute field in PyQGIS

This answer got me close https://gis.stackexchange.com/a/286780/204059, but I only get the last value of my list for all object fields. Example: My list = [REL_1, REL_2, REL_3]. My layer has three ...
Simon's user avatar
  • 89
6 votes
3 answers
9k views

Extracting data using arcpy.da.SearchCursor?

I have a shapefile of point features showing fire locations in a given year. One of the fields is named "YYYYMMDD" and indicates the corresponding date that that fire happened. In Python, I am trying ...
Julio Castillo's user avatar
6 votes
1 answer
4k views

How can I rename multiple feature classes (each different name) using Python?

I have a geodatabase including (cnty06,cnty07,cnty08,cnty09...) that I'd like to rename to (c06,c07,c08,c09...). I can use the ModelBuilder (or script from ModelBuilder) to complete this task. Is ...
mersh's user avatar
  • 61
5 votes
2 answers
5k views

Where is list of Geographic Transformations in ArcGIS, and their areas of applicability?

I have some data in Provisional South American Datum 1956, and I need to project it to Web Mercator with WGS84 as the datum. When I use the project tool in ArcGIS desktop, it requires a Geographic ...
Devdatta Tengshe's user avatar
5 votes
4 answers
948 views

Creating list from field values with PyQGIS

How is it possible to create a list from the values of a single field in a shp using PyQGIS? Example: field_capital_name London Paris Rome list1 = [London, Paris, Rome]
HyPhens's user avatar
  • 516
4 votes
1 answer
3k views

Getting list of all data sources used in ArcGIS Pro project

Is there a way to generate (or access) a list of all data sources used in a ArcGIS Pro project? I would like to avoid going through each layer's property dialog.
Thomas's user avatar
  • 1,735
4 votes
1 answer
1k views

Create a new list from a raster list in R

I am very new to R, so this is tough for me to explain. But, I have a raster list made up of 3872 elements (or separate rasters, I am guessing) and I am hoping to make a new smaller raster list by ...
Larissa's user avatar
  • 81
4 votes
2 answers
5k 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 ...
deepsky's user avatar
  • 479
4 votes
1 answer
464 views

How to sort multi-column lists by first or second column in Google Earth Engine

I have a list with two-segment. var list = ee.List([ [101, 102], [102, 103], [103, 104], [106, 100], [104, 105], [105, 106], ]) How can sort this list by first or second column?
Mehmet C ARSLANOGLU's user avatar
4 votes
5 answers
5k views

Finding the index of a field with its name using arcpy

I want to extract the index of a field with its name using arcpy. It seems what I have written is so dumb. Is there any simpler method with out using for-loop? import arcpy fieldList = arcpy....
msc87's user avatar
  • 393
3 votes
1 answer
837 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?
Nitzan Matan's user avatar
  • 2,857
3 votes
1 answer
2k 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....
Sean Roulet's user avatar
  • 2,200
3 votes
1 answer
74 views

AttributeError when creating list field with QVariant in QgsVectorLayer using PyQGIS

I am trying to create a list-type field for the active layer using the code below, which is not working. Is there any other way to create a list-type field and update the list([1,2,3]) as an attribute ...
Ganesh S's user avatar
2 votes
1 answer
290 views

Returning strings showing all vertices from all polygons in shapefile using ArcPy?

I want to have a string showing all vertices from all polygons in a shapefile. In my example below my code lists all vertices and the first column shows the polygon they are part of (I only have 2 in ...
Giacomo's user avatar
  • 307
2 votes
1 answer
1k views

How to open a list of images from an asset as an Image Collection?

I need to create an Image collection from a list of images that I import from an asset in GEE. This is the code I am using: //THE CREATION OF A IMAGECOLLECTION WORKS WITH TWO IMAGES LOADED HERE var ...
thiagoveloso's user avatar
2 votes
1 answer
295 views

Search or filter values in two-segment list in Google Earth Engine

i have a two-segment list; var list =ee.List([[101,12155],[102,12157],[103,12158]]) i want to search or filter for 102 and get result (12157), for 103 and get result(12158) How can i do it ? i find a ...
Mehmet C ARSLANOGLU's user avatar
2 votes
1 answer
1k views

QGIS 2.14 GRASS geoalgorithms don't work?

I instaled qgis 2.14 and grass geoalgorithms dont work. Only 160 geoalgorithms and should be 168. MsBox: Missing dependensy, It seems that GRASS is not correctly installed and configured in your ...
Frodo's user avatar
  • 2,407
2 votes
2 answers
256 views

Identify and move data containing special characters to a separate column

My dataset contains special characters. I want to identify the data which contains special characters and separate it into a new column. List of special characters : `~!@#$%^&*_{}[]<>?/ ...
Bruno B's user avatar
  • 839
1 vote
1 answer
213 views

How to make a linked-list in Google Earth Engine?

Now, after Noel Gorelick's very helpfull code, i have a sorted list with two-segment: var list = ee.List([ [101, 103], [102, 103], [103, 109], [109, 122], [117, 156], [122, 133], [133, ...
Mehmet C ARSLANOGLU's user avatar
1 vote
1 answer
2k views

Subquery a list in select layer by attribute management using python

I am new to python and having trouble with my script. I want only the records from the COMTRS field (of the pur_dbf_view) that match values from the ComtrsList to be selected; however, I am getting ...
user21681's user avatar
1 vote
1 answer
711 views

Making combobox with list of fields (from layer also selected in combobox) in pyQGIS? [duplicate]

I am new to python and pyqqis. I do not have the methods defined in initGUI how do I do? layers = self.iface.legendInterface().layers() layer_list = [] for layer in layers: layer_list.append(...
robson's user avatar
  • 43
1 vote
2 answers
8k 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');...
till Kadabra's user avatar
0 votes
1 answer
463 views

problem with list.files() in R

here you have my data https://www.eea.europa.eu/data-and-maps/data/corine-land-cover-accounting-layers. I downloaded "CLC2000 Accounting Layer " file and "CLC2018 Accounting Layer" ...
Fabio Castelli's user avatar
0 votes
1 answer
215 views

List the fields for every shapefile I have stored in a list

I am trying to list the fields for every shapefile in 2 lists I have created to prove that each shapefile with the correct projection/feature type within one of the lists got X, Y coordinates added to ...
hanbone's user avatar
  • 33
0 votes
1 answer
339 views

Split list by chunks Earth Engine with mean

I am calculating mean temperature data based on historical data. I need to calculate the mean through the years (jan-jan-jan-jan...) and the means within a year (jan-feb-mar-may-jun...). This is ...
Daniel's user avatar
  • 365