Questions tagged [array]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
39 views

Calculating list of existing polygons with distances from newly created QGIS/PostGIS

I have two polygon tables (SRID=4326) in postgres: t_areas and t_sites. Once I insert through QGIS 3,8 a new area in t_areas I'd like PostGIS (by a trigger) to list all sites within a certain km range ...
0
votes
0answers
26 views

GDAL C# - ReWrite of PY function in C# to CHIP dataset

I am working on a small project that utilises GDAL and its C# bindings. TASK To chip a dataset given the top left and bottom right LAT/LNG coordinates. PROBLEM My resulting CHIP is offset by 40km ...
0
votes
0answers
28 views

How to work in the form of QGIS PostgreSQL fields which is of type array[]

I have a table in a PostgreSQL / PostGIS database where there are columns of type array [] and I would like to know how to work on the QGIS form. Example: I have a column called "WALLS" and that ...
2
votes
1answer
38 views

Sorting polygons into a n x n spatial array

I have a square group of contiguous polygons: By using the centroid coordinates of each polygon, I want to assign each polygon's spatial sequence in a row by row fashion: I have tried this ...
0
votes
0answers
23 views

Processing array of values at cell location across raster maps using ArcGIS Desktop

I have several (say n=10) raster maps with ratings values. At a particular cell location, I would like to create a sum composed of the maximum rating, half the next highest rating, then a quarter of ...
1
vote
1answer
36 views

Raster is flipped when opened as numpy array

I have two rasters of the same dimensions. Opened in QGIS, they align perfectly. However when I open them via GDAL as a numpy array, one of them is flipped and I have to flip it back to make ...
1
vote
1answer
100 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 ...
2
votes
1answer
44 views

Trying to get the max value of two bands and put in to array or variable in GEE

I'm trying to do an array with the maximum value of bands obtained by Reducer.max() with the objetive to get the max value of two bands with Math.max() but in the moment that I tried to make this, ...
3
votes
0answers
37 views

How to fix “Parallel Arrays Must Have Same Length” error for chart

I'm using a transect with two types of data to collect temperature and aerosol index on Google Earth Engine. I want to print a line chart using multiple dates, but I keep getting two error listings: ...
1
vote
1answer
59 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 ...
2
votes
1answer
27 views

Parsing text into a numpy ndarray

I'm trying to parse this string into a numpy ndarray 'POLYHEDRALSURFACE(((0 1 0,0 0 0,1 0 0,1 1 0,0 1 0)),((1 -0 1,0 0 1,0 1 1,1 1 1,1 -0 1)),((1 0 0,1 -0 1,1 1 1,1 1 0,1 0 0)),((0 0 0,0 0 1,1 -0 1,1 ...
2
votes
1answer
61 views

Sort or add Rank within QGIS 3 model

I have the following function in order to add a sorting value to a layer: array_find( array_sort( array_agg("field")), "field") This works fine if I use it through the calculator within the ...
2
votes
1answer
94 views

Rasterio Write Masked Array to TIFF - Shape write and read indices are wrong [closed]

I'm clipping a raster to a shapefile, which returned a masked array, and my goal is to write that masked array to a new .tif file with the correct metadata. I can view the masked array and it looks ...
0
votes
2answers
412 views

Python - Mask raster array using shapefile or rasterio

I have a raster that I have resample using rasterio, where img.shape is (5490, 5490) if img.res[1] == 20: img = img.read( out_shape=(img.count, img.height * 2, img.width * 2), ...
1
vote
2answers
114 views

Cut raster by pixels in GDAL

i've some georeferenced images that have the size of 1280 X 960. I need to cut the outer pixels to have a size of 1220 X 900 (i need to cut 30 pixel for each borders). Can i do this using GDAL or a ...
0
votes
1answer
50 views

Accessing Numpy Array found within an XArray from Satpy

dask.array<shape=(76, 76), dtype=float32, chunksize=(76, 76)> Coordinates: crs object +proj=utm +datum=WGS84 +ellps=WGS84 +no_defs +units=m +zone=33.0 +type=crs * y (y) float64 ...
0
votes
2answers
131 views

Converting GeoTIFF to np array?

I am fairly new to GIS in general. I am having some issues converting a GeoTIFF into an numpy array. There are multiple questions online about how to do it, I've tried, many, with the same result ...
0
votes
0answers
33 views

Local minima filter does not extend to the edges

Trying to run a local minimum filter on a DEM using scipy.ndimage.minimum_filter. I can successfully create the minimum filter output, but it does not extend to the edges of the DEM (see image below). ...
1
vote
1answer
34 views

Creating Raster from Array using GDAL Results in Stripes

I am using a template raster to create another raster with the same resolution/projection/extent from an array. The original raster looks good, but the new raster results in stripes. ds = gdal.Open(...
0
votes
0answers
73 views

Adding 3x4 table in popup template using ArcGIS API for JavaScript 4?

I'm building an arcgis application rendering a csvLayer. I've added a popup template like so: var template = { title: "{SensorTitle}", content: [ { ...
2
votes
1answer
64 views

Updating arcpy.Array() syntax from Python 2.7 to 3.6.6 for ArcGIS Pro 2.3?

I was working through an exercise designed to teach basic Python skills in ArcMap using Python 2.7. The file below consists of 34 pairs of x,y coordinates. The script creates a new empty polyline ...
0
votes
1answer
48 views

Converting raster to array then CSV file using ArcPy? [closed]

I have a raster file and I would like to convert it to an array and then save it as a csv file with using ArcPy. The reason is that I want to do some statistical analysis over each row and column in ...
3
votes
0answers
135 views

Create multipoint layer from array by expression

I have two layers. One shapefile point layer, called "point1" and one csv no geometry layer, called "Meta". "point1" looks like: id bd 1 a 2 b 3 c 4 d 5 e 6 f and so on... "...
0
votes
0answers
222 views

Running Linear Regression with multiple Rasters converted to a numpy array in Python

What I did was an array with Rasters from 2000 to 2018. It's temporal Resolution is 16 days. I more or less wrote my code by combining scripts that I found matching my problem. This is what I got so ...
1
vote
1answer
156 views

Extracting values from array created with FeatureClassToNumPyArray and converted to DataFrame?

I cannot understand how to use the values in the arrays created with arcpy.FeaturesToNumPyArray. I want to create an array and then convert them to a pandas DataFrame. So I created an array from ...
0
votes
1answer
65 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,...
0
votes
1answer
93 views

IDL - calculate mean ignoring zeros [closed]

Imagine the following array: a = [10768,10764,10893,10763,10723,10792,0,0,0,0] Using a function like "MEAN" in IDL, is there a way to calculate the mean value, ignoring the zeros? I know this can ...
2
votes
1answer
276 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 """geog ...
1
vote
1answer
58 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
0answers
122 views

Using Null Values in Raster To NumPy?

I am trying a convert a raster dataset [a simple 4 x 4] into a numpy array using RasterToNumPyArray. Here is my sample raster dataset: RasterToNumPyArray however, returns zero for Null values: ...
0
votes
1answer
77 views

How to push objectIds' array to RelationshipQuery's object in ArcGIS API JavaScript 4.9?

I need to push array of the object IDs to RelationshipQuery's object using executeForIds that generates the array. I also used executeRelationshipQuery that executes the query. I don't not why, but ...
3
votes
0answers
134 views

QGIS 3 - Save processing output to memory and turn into numpy array?

I'm currently developing a python plugin for QGIS 3. In short, the code conducts among others a viewshed algorithm, turns the output in a numpy array and calculates some spatial metrics the user can ...
1
vote
0answers
674 views

Convert Pixel / array position to global coordinates Python

I am trying to convert positions in a raster representing a .tif to the corresponding global coordinates. Converting the whole array to a tif and load it to QGIS everything is referenced fine, but ...
0
votes
0answers
160 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 ...
0
votes
2answers
84 views

Getting matrix from polygon attribute table that represents vertex couples using ArcGIS Desktop?

How can I get a matrix from a polygon attribute table that represents polygon vertex couples? What I want is something like this : A = [ (A1,B1) , (A1,C1) , (B1,C1) (A2,B2) , (A2,C2) , (B2,...
3
votes
1answer
335 views

How to read part of a TIFF as array and export it with its correct coordinates using GDAL?

I would like to be able to read a part of a TIFF file as a numpy array (using read as array(xoff, yoff, xsize, ysize) and be able to export it again to TIFF file, having this subset its correct ...
2
votes
0answers
163 views

GDAL, Geolocation Arrays, and Overflow Error?

I'm trying to use GDAL to create raster images from NOAA GSIP L2 data products. By looking at the provided NetCDF files from NOAA, it appears that geolocation arrays are provided. I tried following ...
1
vote
0answers
41 views

Convert Array of Interger to GeoTiff in Java?

I am having the Hashmap of lat,long which is key for the Integer which represents the color value hashmap<Class of lat/long , Integer> // where class of lat/long is my custom class represent a ...
0
votes
1answer
925 views

Arrays from feature collections in Google Earth engine

I need to convert a Feature Collection containing only numeric data to a 2D matrix. I have written the following code however it gives matA as a list of arrays despite explicit type conversion, here ...
0
votes
0answers
21 views

Create a 3D array from table value

I need to plot the field lines of a 3D vector (Vx, Vy, Vz) of which I have the 3 components at each point of a given 3D grid. One way is to use FLOW3. However, in order to use FLOW3 I need to have the ...
1
vote
1answer
72 views

Generating a raster file using 1D numpy arrays

Explanation: I currently have 3 1D numpy arrays, each having a length of over 100000 points. The first contains the X coordinates of an object, the second contains the Y coordinates, and the third one ...
1
vote
1answer
416 views

Is it possible to do a CQL filtering on an array field in a Postgis DB

I have a Postgis (2.2.3 in PostgreSQL 9.5) database with a view that has aggregate array fields. I can filter on these fields directly on the DB with Select * from myschema."ViewWithArrays" v where ...
1
vote
1answer
107 views

Mapbasic write and read csv into python tuple type structure

In mapbasic I need to read a csv into an array but arrange each row of the csv independently. See the current result, code etc below. I want it to be something like a python dictionary ([Bushfire_V ...
0
votes
0answers
24 views

Arcpy multivalue add to where clause

I'm trying to create my first tool, where will be possible to insert multivaule into process. I need to insert these values to "where clause" but in my code it inserts only one value. Here is my ...
1
vote
1answer
70 views

Writing gridded NetCDF format CF Convention from a 4 dimensional Array in Java [closed]

I am using Unidata NetCDF Java library to write NetCDF, its being written in the classical format, but I want to write it as a gridded NetCDF file (as THREDDS / WMS are unable to read a classic NetCDF ...
3
votes
1answer
224 views

NumPyArrayToFeatureClass output shapefile does not have field names

How do I retain the values and field names in the resulting shapefile's attribute table after using NumPyArrayToFeatureClass? I'm starting out with a 2d array named npGrid and I'm making it into a ...
0
votes
1answer
1k views

Leaflet Routing Machine Dynamically Generate Waypoints

I have a list of address that get geocoded. I want to then take those new lat/lon values and set them as waypoints in Leaflet routing machine so that an long route is generated. I have tried a loop ...
1
vote
1answer
5k views

Python Error: “ValueError: need more than 1 value to unpack”

Can someone help me figure out what is not working in this piece of code: import arcpy import fileinput import os import string from arcpy import env env.workspace = "C:/EsriPress/Python/Data/...
3
votes
0answers
733 views

Warping Image having Lat Lon Geolocation array

I'm trying to implement a script to project an image having the two matrices of Lat and Lon points. I've followed the steps proposed in: Unable to warp HDF5 files and everything is fine. I create the ...
1
vote
1answer
249 views

ReadAsArray() equivalent in C

I'm new with GDAL ... and I'm trying to write some code where I have to read a .raw image and store it as an array of 32-bit floats. It seems that it is easy with python, I just have to use: array = ...