Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [array]

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

2
votes
1answer
31 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
37 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 ...
2
votes
0answers
44 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
55 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
45 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
25 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
29 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
60 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
40 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
42 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
41 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
84 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
264 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
111 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
59 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
188 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
117 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
31 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
411 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
53 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
267 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
94 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
55 views

Writing Gridded NetCDF format CF Convention from a 4 dimensional Array in JAVA

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 ...
4
votes
1answer
147 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
917 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
544 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
200 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
124 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
131 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
274 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
44 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
133 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 ...
1
vote
1answer
333 views

How to 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
522 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
434 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
590 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
638 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
939 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: ...
2
votes
0answers
794 views

How to overcome MemoryError from numpy.unique

I am using Numpy in version 1.11.1 and have to deal with an two-dimensional array of my_arr.shape = (25000, 25000) All values are integer, and I need a unique list of the arrays values. When using ...
0
votes
1answer
393 views

Creating simple polyline geometry objects with ArcPy? [closed]

I'm trying to learn how to create a polyline object from a set of XY pairs. I need to create an empty point object and an empty array object, place the coordinates in a list, and use a for loop to ...
0
votes
1answer
974 views

How to use pgr_dijkstra many-to-many

I am using pgr_dijkstra(or pgr_dijkstraCost) to find the shortest path and/or cost for drawing isochrone map. Since I need to calculate the shortest path from each of over 100,000 nodes to multiple ...
2
votes
1answer
1k views

Removing boundary pixels from numpy array with python

I need to get rid of the border points in an array which came from a raster. I first converted my GeoTiff to numpy array using: input = gdal.Open("file.tif") array = np.array(input.GetRasterBand(1)....
1
vote
1answer
253 views

Leaflet push GPS position to array onLocationFound and search a squared area around this position

So I have this approach of pushing the coordinates of a location to an array: var gpsposition = [], function onLocationFound(e) { gpsposition.push(e.latlng);} Now I have the following questions: Q1:...
1
vote
1answer
438 views

Fill array with coordinates within geographical bounds in Leaflet

I want to create an array and fill it with geographical coordinates I get from a bounds variable. Basically, a for-loop shall create coordinate pairs within the specified bounds with a fixed distance ...
9
votes
1answer
652 views

Use array[] datatype in QGIS from PostgreSQL

I'm just a beginner in GIS, so I'll be glad to see any comment here. I have tables in PostgreSQL which I've connected to QGIS. There are columns in tables with datatype array[]. But it's not easy for ...
0
votes
1answer
112 views

Find Lat and Long points on land only

I'm new to R and GIS so please forgive me if this is a simple request. I was looking for a way to find out if a Lat/Long point is on land or ocean. I found this previous post from a couple of years ...