Stack Exchange Network

Stack Exchange network consists of 174 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

0
votes
1answer
14 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
0answers
12 views

insert data into postgres table getting Array to string conversion php [closed]

Array to string conversion in C:\xampp\htdocs\letsstart\first_php.php on line 37 INSERT INTO public.metadata_xml( namedataset, nametheme, keywords, accessconstrain, userconstrain, purpose, datatype, ...
2
votes
1answer
24 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
0answers
29 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
25 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
22 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 ...
0
votes
0answers
34 views

getFeaturesAtCoordinate() returns empty array

For some features I get an emtpy array with getFeaturesAtCoordinate(). The WFS - GeoJSON is perfectly homogeneous. How can that be? search.on('select', function(e) { select.getFeatures().clear()...
3
votes
0answers
45 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
121 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
66 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
48 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
83 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
92 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
20 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
227 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
37 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
162 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
87 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
50 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
111 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
751 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
3k 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
429 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
154 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
93 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
1k 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
107 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
236 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
37 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
111 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
224 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
446 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
367 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 ...
0
votes
0answers
52 views

Code to open ArcGIS python window from script

What is the code to open an ArcGIS python window? I have a toolbar with a button, that runs my script with the results written to the python window, if it's not open you won't see the results. I'm ...
1
vote
2answers
423 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
494 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
789 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
718 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
343 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
834 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)....
0
votes
0answers
346 views

Write latlng array to gpx file

So I have this small application that stores some GPS values along a route as var position = [lat, lng, height] objects in an array. Now I would like to export this array as a .gpx file. I haven'...
1
vote
1answer
216 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
354 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
522 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
100 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 ...
0
votes
1answer
891 views

Add additional markers to existing featuregroup in Leaflet

It is possible to add additional markers to an existing featuregroup after it has already been added to the map?
3
votes
1answer
2k views

Extract geojson 'properties' dynamically with mapbox gl

I have an interactive map based on MapBox WebGL. I have an 'on click' function which is returning all information on data layers at that location (lovely). For each object I am trying to pull out ...