Questions tagged [array]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
21 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 ...
Nihilum's user avatar
  • 143
1 vote
0 answers
32 views

How to use the field calculator array_mean() function in Python console QGIS

I have a layer with USA counties; each county has a unique identified 'COUNTYNS' and a field "CO_mean_microg_m3". Some counties have this CO value as NULL, so I want to take the 6 nearest ...
Mariia Murasheva's user avatar
0 votes
0 answers
27 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. ...
Bruno B's user avatar
  • 769
1 vote
1 answer
44 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(...
sermomon's user avatar
  • 1,084
0 votes
0 answers
21 views

gdal.Warp reading 2d multichannel array incorrectly - loading bands (3) as the y axis

We have a python script that downloads NOAA GOES satellite NetCDFs, and processes the image datasets via Pillow\OpenCV. Then I convert it back to a GDAL dataset in order to translate and warp. With a ...
John Lawler's user avatar
0 votes
1 answer
140 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 ...
Andrea's user avatar
  • 49
4 votes
2 answers
513 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 ...
GeoGyro's user avatar
  • 1,566
1 vote
1 answer
133 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 ...
One's user avatar
  • 13
1 vote
2 answers
101 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,...
chrisp66's user avatar
2 votes
1 answer
104 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 ...
Nihilum's user avatar
  • 143
2 votes
1 answer
128 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: {"...
user222026's user avatar
1 vote
0 answers
62 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 ...
CARL JUSTINE NAVARRO's user avatar
0 votes
0 answers
44 views

Google Earth Engine error -- 'array: parameter values is required'

I'm using the monitoring vegetation condition code, and when running I get an error 'array: parameter values is required' This is the code I'm using: // Get MODIS 250m vegetation data. var mod13 = ee....
Linda Pacaud's user avatar
0 votes
1 answer
155 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:...
sermomon's user avatar
  • 1,084
1 vote
0 answers
234 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 ...
TmtStss's user avatar
  • 23
0 votes
0 answers
65 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?
Claudio's user avatar
  • 26
0 votes
2 answers
155 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,” ...
Endalkachew Kebede's user avatar
3 votes
2 answers
96 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
  • 51
0 votes
1 answer
107 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),{},"...
Reflex_180's user avatar
4 votes
1 answer
230 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", "...
MartinMap's user avatar
  • 8,196
4 votes
1 answer
103 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. @...
Julio Palomino's user avatar
1 vote
0 answers
37 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 ...
Helena's user avatar
  • 81
0 votes
0 answers
56 views

Unknown CRS of python script output file

I have a set of .tif files which are georeferenced to the CRS EPSG:32632. A sequence of gdal:rastercalculator operations are perfomed. At this point, the output files are still properly georeferenced ...
Joep_'s user avatar
  • 23
0 votes
0 answers
59 views

How to correctly merge 2D and 1D arrays in Google Earth Engine LandTrendr outputs?

I follow LandTrendr guide to make temporal segmentation of Landsat time series for a given area. I try to merge 'LandTrendr' output (2D array, where 0 axis means 4 rows with data, and 1 axis means ...
Maksym Matsala's user avatar
0 votes
0 answers
153 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 ...
Arun.R's user avatar
  • 1
1 vote
0 answers
179 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)...
emax's user avatar
  • 259
1 vote
1 answer
57 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 ...
surdeep's user avatar
  • 51
0 votes
1 answer
373 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 ...
surdeep's user avatar
  • 51
-1 votes
1 answer
201 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 (...
linda theres's user avatar
1 vote
2 answers
128 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 ...
sermomon's user avatar
  • 1,084
4 votes
1 answer
228 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 ...
fausto ugozzoli's user avatar
3 votes
1 answer
1k 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 {'...
arkriger's user avatar
  • 315
2 votes
2 answers
428 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 ...
Isa's user avatar
  • 155
7 votes
1 answer
308 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 ...
LeoNazareth's user avatar
1 vote
2 answers
178 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) ...
GisT's user avatar
  • 81
2 votes
1 answer
232 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 = ...
Việt Nguyễn Đức's user avatar
2 votes
1 answer
355 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,...
User1974's user avatar
  • 1,114
4 votes
1 answer
186 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 ...
pr_'s user avatar
  • 43
3 votes
1 answer
753 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 ...
LostinSpatialAnalysis's user avatar
4 votes
1 answer
454 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 &...
reedwanKazi's user avatar
9 votes
4 answers
686 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-...
pigreco's user avatar
  • 4,315
3 votes
2 answers
218 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 ...
parallax's user avatar
  • 1,472
0 votes
1 answer
704 views

Loading data from array in popup when country is clicked in React Leaflet

I'm newbie and I have interactive web in react using leaflet library and now I need to load "title" data from array to a map. So when I click on some country, popup will show up with this ...
loklba's user avatar
  • 43
4 votes
4 answers
770 views

Replacing strings from multiple array elements delimited by commas in QGIS

In QGIS 3.18, I have a vector layer of 1000+ features with 100+ attributes, many of which are strings of concatenated elements (substrings) delimited by commas. Some of those elements need to be ...
pete's user avatar
  • 1,051
1 vote
2 answers
312 views

How to create a NetCDF file with Albers conical equal area projection in Python

I was wondering how to create a NetCDF file with the following dimensions and variables; <class 'netCDF4._netCDF4.Dataset'> root group (NETCDF4 data model, file format HDF5): Conventions: CF-...
user195787's user avatar
1 vote
0 answers
664 views

Ploting GEE image with imshow and adding an cartopy.io.img_tiles using add_image

I transformed a GEE image in an numpy array and I'm trying to plot a this array using plt.imshow() with a background image of cartopy image tiles (cimgt) with .add_image(). However, the array and ...
Izaeljr's user avatar
  • 13
4 votes
3 answers
676 views

Get more than one elements from array in QGIS expressions using square brackets

Using QGIS expressions, if you have an array, you can get the n-th element by simply adding a number (n) in square brackets (starting with 0 for the first element). Like this, array (1,2,3,4,5,6,7,8)[...
Babel's user avatar
  • 63.1k
0 votes
0 answers
400 views

Using ArcPy cursor to insert polyline

I'm trying to use an InsertCursor to write code where I insert a line segment from two points in the shapefile, but I keep getting a type error explained below import arcpy, os, traceback fc = 'C:/...
Ellie 's user avatar
  • 69
0 votes
1 answer
528 views

Creating a dependent drop-down list in Google Earth Engine [duplicate]

I am trying to create a dependent drop-down list in Google Earth Engine that will respond to the input from the first list. I am basing this off an example provided by Google Developers... https://...
Eli Simonson's user avatar
3 votes
2 answers
684 views

Array for_each in QGIS

Is there an expression in QGIS for array for_each to get the element from the output of geom_to_wkt($geometry) of the polygon and correspondingly transform the element (using the expression of LAT ...
ROEL SANTIAGO's user avatar

1
2 3 4 5