Questions tagged [array]

An arrangement of quantities, symbols or objects in rows and columns; a matrix

Filter by
Sorted by
Tagged with
4 votes
1 answer
1k 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 ...
MDB's user avatar
  • 155
4 votes
3 answers
9k views

Editing .tiff rasters in Python

I am trying to edit .tif rasters in python, but I have some issues regarding the tiff to array conversion. I read there are multiple options for opening rasters (gdal, PIL, matplotlib), but which of ...
Litwos's user avatar
  • 338
10 votes
2 answers
13k views

Optimizing Python GDAL ReadAsArray

I am using the GDAL ReadAsArray method to work with raster data using numpy (specifically reclassification). As my rasters are large, I process the arrays in blocks, iterating though each block and ...
ssast's user avatar
  • 327
7 votes
3 answers
14k views

Is it possible to open rasters as array in NumPy without using another library?

I know that it is possible to open a raster as an array in NumPy using GDAL, but I want to skip GDAL and use NumPy only, as it is cooler handling rasters with NumPy as matrices. There is a similar ...
multigoodverse's user avatar
3 votes
1 answer
531 views

Automatically create an array of all visible layer names in QGIS

How can I get an array of all visible layer names automatically using QGIS expressions? In principle it should work with the variable @map_layers. Using the following expression works fine for what I ...
Babel's user avatar
  • 71.2k
1 vote
0 answers
1k views

reading raster without making QGIS apply the scale factor to the raster

Since QGIS multiplies the image with the scale factor when reading, it messes up the image if the scale factor is not properly defined to the data as QGIS expected. For example, I am reading MODIS ...
aly's user avatar
  • 139
12 votes
3 answers
704 views

Handling multiple selections result in "Value Relation Widget" in QGIS

Using the "Allow multiple selections" in the "Value Relation Widget" results in {value1,value2,...}. But arrays in QGIS are written like ['value1','value2',...]. How do I handle ...
MartinMap's user avatar
  • 8,262
5 votes
2 answers
129 views

How can cumulative point data be labelled in QGIS?

With the following code I can generate a listing. However, the entire list is displayed and not the data of the attribute of the respective geometry. 'Schäden: '|| array_to_string( array_agg( &...
Alex's user avatar
  • 71
4 votes
1 answer
4k views

Select features matching the values in an array (QGIS 3.10 expression)

I want to use an expression to select features matching the values of an array. Select features from a list is done by the IN operator: "field" IN ('value1','value2') But how to select features ...
MartinMap's user avatar
  • 8,262
4 votes
1 answer
468 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
3 votes
2 answers
127 views

QGIS Field Calculator Expression to retrieve index of specific value

I have two tables: [see image beloW] HAK where the Column "Volumenstrom_h" has the input value ( x ) needed for the linear interpolation formula displayed which can be seen surrounded by ...
Denis Crîlov's user avatar
3 votes
1 answer
326 views

QGIS expressions: remove several elements at once from an array

The problem Using QGIS expressions with QGIS 3.20, I have an array and I want to exclude a number of elements from this array. Let's say my array is [1,2,3,4,5,6], but I want to get an array like [1,2,...
Babel's user avatar
  • 71.2k
3 votes
1 answer
374 views

Create Array From Selected Features Based on the Order in Which They Were Selected

I need to create an array of features from a selection based on the order in which they were selected. As in: I select feature 5,2,3,4. I need to have an array so I can apply attributes (with python) ...
Cody Brown's user avatar
  • 4,387
3 votes
1 answer
2k views

Methods for converting a regular polygon grid to a numpy array

I have a regularly spaced model grid, 5000 by 5000 feet (517,300 cells), which I need to convert to a numpy array. I am investigation a couple of different methods, using arcpy, by which I can convert ...
Jason Bellino's user avatar
3 votes
3 answers
1k views

Creating polygon from 2 txt files (Parent ID + Coordinates) using ArcPy?

I want to create polygons based on two separate text files: the first one (as parents) lists the Polygon ID (ID_el) and three to four Points ID (IDpt1, IDpt2, IDpt3..) the second contains the Points ...
PMessager's user avatar
  • 407
2 votes
1 answer
973 views

Get data from a raster using two coordinate arrays with Python

I'm trying to find a function in Python, that given two arrays with geographic coordinates, returns a list or array of raster values in those positions. that is to say: import numpy as np ""&...
Edward Oswaldo navarro Astudil's user avatar
2 votes
1 answer
356 views

Determining proportion of raster cells containing each value from list for many rasters in raster stack?

I wrote a function to determine the proportion of raster pixels that contain each of a list of values that I would be interested in. I then wrote a function to apply the previous function to a 3d ...
RyanM's user avatar
  • 103
2 votes
2 answers
5k views

How do I sort a geoJSON feature collection alphabetically by a property value?

I am trying to sort the objects in a geoJSON FeatureCollection alphabetically by the values of one of their properties. How do I get to the nested object properties with JavaScript? I have tried using ...
Jen's user avatar
  • 21
2 votes
1 answer
851 views

Can I view a Postgis Geometry Array in QGIS?

I've got an array of geometry as a column in a postgis database. Is it possible to view the data (even the n'th element?) in qgis?
Gary T's user avatar
  • 55
1 vote
1 answer
134 views

Error with array_foreach when using together with aggregate in QGIS expression [closed]

I want to use array_foreach functionality. But it does not seems to work when used in an aggregate function. This intermediate test ( array predefined, instead of array generated by another aggregate),...
ClaudeVer's user avatar
  • 630
1 vote
1 answer
964 views

Importing gdal_array from gdal in Conda

I'm working through python examples in a geospatial book using jupyter notebook and have run into trouble trying to import gdal_array from my gdal installation. I've seen several old questions and ...
jport's user avatar
  • 437