Questions tagged [array]
An arrangement of quantities, symbols or objects in rows and columns; a matrix
213 questions
0
votes
1
answer
50
views
Labelling with unique value and concat
I would like to configure the labels so that they can meet these conditions:
a label by unique "MeasurementPointName"
for each unique value "MeasurementPointName" + "JarNam&...
0
votes
1
answer
76
views
Filter an array with attribute from another layer in QGIS
I have two layers with very similar tables
Layer 1:
id
section
1.1
A
1.2
A
1.3
A
2.1
B
3.1
C
3.2
C
At first I needed to summarize all id´s that belong to one section (e.g.: '1.1, 1.2, 1.3' for ...
1
vote
1
answer
35
views
Using forward differencing on image collection containing masked pixels
I'm interested in obtaining the time difference between each observation in an image collection. This can be calculated as the DoY difference between each subsequence image in the image collection. ...
1
vote
1
answer
46
views
Getting 1-D array (vector) from image collection or multi-band image using Google Earth Engine
I'm using Google Earth Engine and I need to convert an image collection into a single 1-dimensional array containing all pixel values. In my example I will use a multi-band image since image ...
0
votes
0
answers
42
views
Create an array of band names where the pixel value is 1 in Google Earth Engine
I have an image in GEE with 20 bands, each corresponding to one year. Indeed, I have a time series. Each band can have values 1, 0, or -1. Value 1 means a specific event starts, and value -1 means the ...
2
votes
0
answers
125
views
Using PostgreSQL Array Data in GeoServer
I'm working to setup GeoServer on a table, and ran into a new issue where one of my fields is a PostgreSQL Array of type text[] that stores tags. I'd like to be able to use and query that field in ...
2
votes
1
answer
123
views
QGIS Field Calculator Expression: get field name for value at specific index
I am looking for a way to search the field name ( green circle ) of a value at a specific index.
In the example shown above I would like to find the field name "25 x 2,3" for the value of ...
3
votes
2
answers
191
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 ...
0
votes
1
answer
383
views
Extracting confusion matrix values in GEE
I am training a random forest model in Google Earth Engine, and I want to output the confusion matrices so I know which classes are being confused for which.
By default, the confusion matrix is ...
1
vote
1
answer
60
views
Mask out pixels by array length in GEE
I have an image array resulting from the continuous change detection algorithm. Because arrays represent the characteristics of each break in the image series, the pixels have different array lengths.
...
0
votes
1
answer
89
views
GEE: arraySlice to find first, second, third, etc. entries in image array
I'm working off of a great tutorial on continuous change detection from this book chapter. I use the tutorial data and code to demonstrate the issue I'm encountering.
Using a stored array image, we ...
1
vote
1
answer
188
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),...
0
votes
1
answer
234
views
Compute mean value of a band on each image in an Array
I try to compute the mean value of a band on each image of an imageCollection and store all the values in a Array to compute the RMSE with another dataset that I will also store in an Array (not sure ...
0
votes
0
answers
25
views
Generate and populate a grid from points in a geopandas dataframe [duplicate]
Context:
I have a geopandas dataframe, with two columns
'geometry': full of shapely.geometry.point.Point.
'h_mean': gathering the height of a surface at those points
I want to create a 2D spatial ...
0
votes
0
answers
52
views
Align the points in polygon
I have two datasets consits of building footprints and point data.
Points are within the footprint but they are scattered. Is there any tool to align them perfectly within the polygon as pattern.
...
1
vote
1
answer
146
views
Convert RasterStack object to Array and Array to RasterStack
I have a RasterStack object. I need to convert it into an array and then convert this array into a new RasterStack.
library(raster)
Here a RasterStack example:
m <- raster(ncol=10, nrow=10)
values(...
0
votes
1
answer
535
views
Convert WRF NetCDF to TIFF
I have a NetCDF file, output of a WRF model, which contains a time series of some variables. You can download it here (Warning: 7GB download). Here is the gdalinfo output:
Driver: netCDF/Network ...
4
votes
2
answers
2k
views
Unesting JSON array in SQLite [closed]
I'm using DB Manager on QGIS to write a view. I want to "translate" unnest() SQL function, but I don't find the same in SQLite.
SQL
SELECT unnest(ARRAY['A','B','C']);
unnest
A
B
C
The ...
1
vote
1
answer
424
views
Filling in attributes from a different layer in QGIS batch mode
I have a point layer with an X,Y field, containing the coordinates of each point separated by a comma.
I'm trying to batch process r.water.outlet based on these X,Y values from a different layer, the ...
1
vote
2
answers
456
views
PostGIS ST_Union using array of geometries
I'm new to PostGIS and I have a set of layers that need to be merged and dissolved. I have no problem doing this for 2 input layers using ST_Union(geometry g1, geometry g2), but for more than 2 layers,...
2
votes
1
answer
399
views
Make a polyline shapefile out of a mask, but do not count the boundaries of the array in the polyline
I have 3 DEMs that I mask: non-NaN values = True and NaNs = False.
I have an algorithm that plots the boundaries of the masks, but the issue is that it also plots the boundaries of the array of the ...
2
votes
1
answer
395
views
'Invalid GeoJSON geometry' error while exporting an array as CSV in Google Earth Engine
My variable array1 is a list of objects. I am trying to export this list as a table in Excel to do work on that. However, the error I am getting is this:
Line 184: Invalid GeoJSON geometry: {"...
1
vote
0
answers
92
views
Inserting time dimension into 2d array (lon, lat) to create 3d array (time,lat,lon)
I'm trying to create a 3d array with 'time, lat, and lon' dimension. My data is from trmm 3b42 v7. Can someone help me with what should I do. The following are the codes I created.
from netCDF4 import ...
0
votes
1
answer
284
views
How to download a image array in Google Earth Engine?
I'm trying to export an image array produced by the ee.Algorithms.TemporalSegmentation.Ccdc algorithm. This is a 1D image array. I'm trying to export it using:
Export.image.toDrive({
image:...
2
votes
0
answers
405
views
How to fix Google Earth Engine ee.Image.getDownloadURL inconsistent output array dimensions
ee.Image.getDownloadURL(..., {'dimensions': '100x100', ...}) occasionally returns arrays with shape (101, 100) or (101, 100) or (101, 101) instead of the expected (100,100). I can't explain it since ...
0
votes
0
answers
76
views
Backward transformation of georeferenced image: from GeoTIFF to TIFF
What's the processing procedure to realize a backward transformation, from a GeoTIFF image to its native array of pixels?
Do you have any suggestion?
0
votes
2
answers
243
views
Iterate through multiple arrays from several folders and perform calculations
Iterate through multiple arrays, each having multiple arrays
I have three folders, each containing 675 NumPy arrays. I want to iterate over each array in each folder.
My first folder is “Barleyarea,” ...
5
votes
2
answers
142
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(
&...
0
votes
1
answer
227
views
Print chart error: "User memory limit exceed"
I tried to plot the SAR backscattering vs the Crop Water Stress Index using the following code:
var CWSI= ndvi.add(ndwi).rename('CWSI')
print('CWSI',CWSI)
Map.addLayer(CWSI.clip(Hoshiarpur),{},"...
4
votes
1
answer
446
views
Translating array into list or map and back in QGIS
Arrays in QGIS look like:
[ 'WID00037-LDB', 'WID00027-LDB', 'WID00026-LDB' ]
This kind of List or Map generated by QGIS Value-Relation Widget look like this:
{ "WID00037-LDB", "...
4
votes
1
answer
152
views
Numbering row based on date field in QGIS [duplicate]
In QGIS 3.28 I just want to create a row number (Column "Número") based on the date of the column on the left ("Fecha"), I'm sure it's pretty easy but I'm completely new.
@...
1
vote
0
answers
66
views
Finding lowest and second lowest values within selection, using expressions QGIS 3.24
I need to calculate the closest and second closest point in one layer, measured from points in another layer. I have used Qgis Network Analysis "OD Matrix as table from layers" which gives ...
0
votes
0
answers
232
views
Create raster from numpy array with boundaries
Working on creating a raster with a constant value for all pixels for land with python. A sample raster is read to get the projection, geotransformation for the the new raster. The raster has the US ...
1
vote
1
answer
463
views
Change values of pixels of a GeoTIFF in Python with conditions
I would like to change the values of pixels based on some conditions. I am using rasterio and python to modify the values.
This is what I am doing
import nunpy as np
import raterio
def changeLabel(arr)...
1
vote
1
answer
78
views
Reading and storing 1st pixels from multiple rasters
I want the code to read 1st pixel from a bunch of rasters (for eg. 1st pixel from 6 different rasters (having same extent and same number of pixels) and convert it into array followed by reading 2nd ...
0
votes
1
answer
503
views
Reading multiple rasters in folder
the rasters in that folder has dates in the naming (for eg. T43RGP_20220330T052639_NDVI) and I want the code to read the rasters one by one in the increasing order of the date.
Help me complete this ...
-1
votes
1
answer
234
views
Calculate sum of comma separated decimal values in QGIS [duplicate]
The field has decimal values separated by comma and I want to find the sum of those values.
When I run the below code
if (
lengths is NULL,
NULL,
array_sum (
array_foreach (...
1
vote
2
answers
224
views
Array transformation: RasterStacks of time-series into Array of matrices
I have 9 RasterStacks with 65 layers containing time-series of satellite imagery. Each stack contains a time-serie of each Sentinel-2 band (B2, B3, B4, B5, B6, B7, B8, B11 and B12). The shape of the ...
4
votes
1
answer
435
views
Filter array with a field value
I need to filter filenames (like DJI_0147_3_5.jpg) in an array, and the code below works, but, where you see a 3 in regex, I need instead a field value.
In the array output (sourcefile field) we have ...
3
votes
1
answer
2k
views
Converting column with LineString geometries to np.array
I have a GeoDataFrame of a street network with the geometry of each row as a LineString. Say something like:
type id tags geometry lanes bridge name highway
0 way 34953479 {'...
1
vote
2
answers
665
views
GEE: Export an Array into a Table
I have created an array with the results of a Pearson correlation between image bands.
I want to convert that array into a properly structured Table.
Currently, I am able to export it, but the output ...
7
votes
1
answer
417
views
QGIS - Connection Lines using geometry generator between 2 layers in a relation N-1
I would like to know if there is any way to generate a connecting line between 2 points layers (blocks-points representing a watershed, concpoints-points representing the concentration location of the ...
1
vote
2
answers
213
views
Raster to Numpy array for aspecified area, search maximum value using ArcPy and numpy
I want to filter the maximum value within a given area using the fastest method possible. I don't want to load the input files (several 100s of full size, classified Sentinel 2 images, integer) ...
2
votes
1
answer
328
views
Array (Error) Array: Unrecognized type, may only use numbers or lists, found type Array
I am getting this error when trying to subtract the array with its mean value in Google Earth Engine JavaScript API
var from = ee.Array([2,3])
var meann = from.reduce(ee.Reducer.mean(),[0])
var to = ...
2
votes
1
answer
524
views
Converting array to polyline using Arcade with ArcGIS Pro
Arcade/ArcGIS Pro 2.9:
I have an array of polyline vertices:
[[[670634.3148,4862051.3579,null],[670719.3321,4862051.0072,null],[670721.44381227,4862055.2956567,null],
[670724.26721751,4862059.1529319,...
4
votes
1
answer
250
views
Advanced labeling in QGIS to automatically get data from new fields and create arrays
I'd like to be able to easily get quick data from different projects I work in in order to avoid having to do sql queries all the time. So here's the thing, today I managed to get the following ...
3
votes
1
answer
1k
views
Unable to write raster from array using rasterio
I have two raster files, raster1 and raster2. I want to take raster1 and divide it by raster2 and produce an output raster for this calculation. I am using python and the rasterio package.
For info on ...
4
votes
1
answer
797
views
Update array geometry field using array lat & long field in PostGIS
I have two array columns in Postgres named lat and long. Both have 1-5 values in their array field. Like the following
Now I need to create geometry from each value based on the array index of lat &...
9
votes
4
answers
900
views
Sorting alphanumeric array numerically using QGIS Field Calculator
For each street I have a list of house numbers in a column of a CSV file and I need to sort them numerically:
House numbers are separated by -.
name
list
sorted_list
street A
5/A-5-4-8-3-6-9-7-1-10-...
3
votes
2
answers
284
views
Comparing arrays in QGIS
I want to compare two arrays and if they match exactly a specific value should be assigned to a field. For instance, if the values in "sumEHZ" are [A,B] or [B,C] the lower value should be ...