The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [array]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
34 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
50 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
37 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
25 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
66 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
30 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
29 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
40 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
46 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
43 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
103 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
149 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
98 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
42 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
52 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
181 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
48 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
79 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
59 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
111 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
428 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
136 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
70 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
260 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
139 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
36 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
660 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
20 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
61 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
342 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
102 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
65 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
184 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
4k 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
653 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 ...
0
votes
1answer
223 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 = ...
1
vote
0answers
155 views

Using RasterToNumpyArray and numpy instead of Spatial Analyst?

I have 5 rasters (6 bands, but only need bands 0, 1, and 5) for which I need to calculate several vegetative indices, including the Excess Red Index (ExR) and Color Index of Vegetation Extraction (...
1
vote
2answers
2k views

leaflet popup styling as a table

I am using leaflet 1.0.3 with bootstrap 4 and I need to set a better styling for the popups, I'm thinking in probably a bootstrap modal or in a sidebar in which every time someone clicks the geoJSON ...
0
votes
1answer
155 views

How do I ignore points in a shapefile which do not overlay a raster in python?

I have a geo-referenced tiff file and a point shapefile. I want to ignore all the points in the shapefile which are outside raster's boundary.
0
votes
1answer
323 views

multipolygon: switch coordinate arrays with javascript/jquery [closed]

I have a geojson with multiple arrays, such as: [[10.77932197941255,52.03584196145097],[10.77932197941255,52.03575906909681],[10.779636389761993,52.03575906909681],[10.779636389761993,52....
0
votes
1answer
52 views

Populate field using a combination matrix

I have a polygon shapefile that represents combinations of soil hydrologic type (A,B,C,D) and soil cover (53 different possible covers, coded from 0 to 53). Each of the 53 soil covers can be either ...
1
vote
1answer
155 views

How to treat PosgreSQL array fields in QGIS rule-based styles filters

In a PostgreSQL/PostGIS DB I have a table with an attribute declared as a 1-dimensional integer array INTEGER[] holding a value like {1,2,3,4,5}. Now I would like to build a rule-based style and need ...
2
votes
1answer
416 views

Open and read spectral library as array in Python?

I'm creating a spectral library in envi and I need to read this as an as array in python. I'm trying to use pysptools (pysptools.classification.SAM) package but i don't understand how to do this from ...
1
vote
1answer
586 views

Fastest way to write large numpy arrays to feature class: as rows, or as columns?

I have a numpy data processing loop that repeats ~50,000x and outputs ~23 data values. I want to write this data to the attribute table of my ~50,000-point multipoint feature class. With each loop, I ...
0
votes
1answer
527 views

Why memory map file is larger than original slide

I am having a tiff slide with the dimension of 90112 x 100352. The slide size is 1.3GB . To process this slide i am creating a numpy memmap file with above dimension like below. If I check the size ...
1
vote
2answers
734 views

Get the edge pixels between 2 classes

I am trying to get the edge (the pixels that are in the border of 2 classes). I have a raster with 3 different values, and I want to keep just the pixels that are in the contact between class 1 and ...
1
vote
1answer
717 views

Arcpy creating Polyline from dictionary values

I am attempting to do the final project for the open source Penn state class https://www.e-education.psu.edu/geog485/node/144. The task is too parse a csv of rhino coordinates and create a polyline. ...
4
votes
1answer
1k views

R package gapfill: How to convert R raster stack to 4-dimensional array and then back to raster stack?

I'm currently analyzing MODIS EVI time series (MOD13Q1) for a small region between 2000 and 2015. Now, I would like to fill missing values using the new R package gapfill. What I have done so far: ...