NumPy is an extension to the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large library of high-level mathematical functions to operate on these arrays.

learn more… | top users | synonyms

1
vote
1answer
24 views

Downsampling Geotiff using summation - Gdal/Numpy

I am trying to downsample a 1 square km raster dataset to a much larger (.5 degree x .66 degree) dataset by summing all of the pixel values within this large grid cell. gdal_warp does not contain a ...
-2
votes
0answers
24 views

NumPy Array to Feature: Expected a readable buffer object [closed]

I am consuming data from a json web service with NumPy array to feature class an am receiving a TypeError: expected a readable buffer object. What is the cause of this? containerItems = [] ...
1
vote
0answers
47 views

ArcPy reading a raster in a moving window?

I typically read large raster data using gdal and setting up a moving window of 256*256 pixels (for example). I recently had to do some processing using arcpy, so I did the same thing, using ...
1
vote
1answer
62 views

Compute annual mean of overlapping cells using daily rasters

I am stuck at somewhat simple looking calculation. I have daily temperature rasters from 2001 to 2014 with following name format: `2001001` `2001002` | | `2014365` I want to compute annual mean ...
0
votes
1answer
43 views

How to place an numpy array into GeoTIFF image using python-gdal

I am attempting to export data of varying scales into GeoTIFF images...a new method for me. The problem I'm running into is when using the GDT_Byte pixel type, data values < 0 and > 256 are not ...
-2
votes
1answer
34 views

NumPy Array to Feature Writes only first array object to feature class [closed]

I am consuming a json web-service with NumPy Array to Feature, I have many nested try/except blocks to consume the data/find errors/etc. The script is functional, however I am having trouble seeing ...
1
vote
1answer
47 views

QGIS / Python: Fill new field with values based on other fields and lookup table

I am trying to use Python for QGIS to add values to new fields in an attribute table based on existing fields and values in a lookup table. Attribute table I wish to modify (with example rows): farm ...
2
votes
0answers
31 views

Converting points using FeatureClassToNumPyArray to interpolate cross-section with scipy “interpolate” [closed]

I'm trying to plot elevation cross section and extract elevations along a cross section using scipy's "interpolate" function. I'm converting a point feature class of profile elevation points to 2 ...
0
votes
1answer
52 views

gdal_array.SaveArray() leaves dataset open in Python

When I use gdal_array.SaveArray() to create a raster, the newly created dataset appears to stay open in Python, preventing other processes from working with it. For instance, consider the following ...
3
votes
2answers
123 views

Efficient ways to read table data from a large feature layer?

I have a feature layer that contains about 460,000 records and it currently takes about 20 minutes to read that table using the arcpy.da.TableToNumPyArray() tool. Is there a more efficient way to read ...
1
vote
1answer
38 views

NumPy Array to Feature Class: NameError from Inner Loop Variables

I have a NumPy Array to FC script that parses a JSON web-service. The outer loop writes to my FC correctly, however my inner loop variables come back as not defined when appending the items. The ...
3
votes
0answers
109 views

How does gdal_calc numpy operators work?

Gdal_calc manual Gdal_calc is introduced as : gdal_calc.py - Command line raster calculator with numpy syntax gdal_calc.py [-A <filename>] [--A_band] [-B...-Z filename] [other_options] ...
0
votes
0answers
38 views

Python error in array declaration

I am getting a error as follows File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy__init__.py", line 2292, in NumPyArrayToRaster return _NumPyArrayToRaster(*args, **kwargs) ValueError: ...
0
votes
1answer
119 views

Fixing Raster Calculator Error 000539 ImportError: No module named numpy? [duplicate]

I've created 4 hillshades for a particular area to represent the 4 seasons in a year. The equation I now need to use to determine solar insulation is 1000*hillshade/255 in raster calculator. However, ...
0
votes
1answer
159 views

ArcGIS Raster Calculator error 000539 ImportError: No module named numpy?

I am running ArcGIS 10.2.1 on Win7 64bit. I have finished doing an NDVI, and after defining a vegetation presence threshold at 0.05, opened the Raster Calculator (via Map Algebra in the Arc Toolbox) ...
3
votes
1answer
80 views

Replicating result of gdalwarp using gdal Python bindings

I am trying to re-project/resample with the GDAL python bindings, but am getting slightly different results compared to those from the command line utility gdalwarp. See update below for shorter ...
0
votes
1answer
86 views

Is it possible from the list or np.array, updating the table using arcpy.da.UpdateCursor?

I have created array. Is it possible to update an existing table if the number and order of columns and rows identical? In the array do not have a column headers. for example: array = ...
1
vote
2answers
69 views

Trouble importing NumPy in GRASS. Architecture

I can't get GRASS to work on my system, and after doing some digging I think it is related to me using 64-bit python. I'm not really sure. I get this message... This module requires the ...
1
vote
0answers
21 views

Raster Vector stack

I want clipped image of NDVI for a particular area. I did raster calculation for getting the image with NDVI values. After that I tried extraction function clipper. In this function we have to use two ...
1
vote
1answer
189 views

errors after installing 64 bit background geoprocessing on ArcGIS desktop 10.2.2

I installed 64 bit background geoprocessing on my ArcGIS 10.2.2 and then changed my pythonpath to "C:\Python27\ArcGISx6410.2" so that my code can benefit from the 64bit. then I had to install a 64b ...
3
votes
2answers
316 views

Downloading raster data into python from postgis using psycopg2

I have raster data in a postgres table that I want to get into python as a numpy array. I am using psycopg2 to connect to the db. I am able to download the data but it comes back as a string (probably ...
4
votes
2answers
1k views

Obtain coordinates and corresponding pixel values from GeoTiff using python gdal and save them as numpy array

How to obtain projected coordinates as well as the actual pixel values at those coordinates from GeoTiff file and then save them into a numpy array? I have arsenci020l.tif file, and its coordinates ...
1
vote
1answer
58 views

Wrong coordinates after Usage of NumPyArrayToRaster(…)

My Project I am currently working at should enable cellvalue manipulation on raster files using ArcPy. My Script works fine except I am not getting the right Y-Values (northing values) for the ...
0
votes
0answers
142 views

Fitting Time-series Values with a Gaussian Function

I'm trying to fit a stack of NDVI values to a Gaussian model to allow for determining dates of certain NDVI values using Python and NumPy/SciPy. I've attempted to do this with ...
1
vote
1answer
68 views

Multiply raster by Numpy derived float value

So I have a python script that uses numpy to calculate the mean of a field, then I try to use that mean value in a raster multiplication as follows: na = ...
5
votes
1answer
128 views

PySAL natural breaks from Numpy array

I am attempting to extract natural break values from a raster using Python. The intended process goes: Arcpy raster object to NumPy Array (using RasterToNumPyArray) to natural break values (using ...
4
votes
1answer
176 views

What's the most efficient way to load feature attributes into a numpy array?

I am currently working on an add-on that relies on the user choosing fields of tables (that can be from shapefiles, csv or dbf) that are open in QGIS and then making computations with such data. ...
1
vote
1answer
178 views

Migrating data from Python to PostGIS

I have pandas DataFrame with these columns: point datetime value 1 Point(-24.6064453125 26.3683280945) 2014-09-11 19:00:00 24.885258 2 ...
1
vote
2answers
1k views

Error "unsupported operand type(s) for +: 'int' and 'NoneType' for variance in python

I recently came up with an error in a script I am working with in Python for ArcGIS 10.1. The strange thing about it is that this script works for some files and not for others. Any ideas as to why ...
1
vote
1answer
298 views

Convert WKT (or geojson) geometry to numpy array of coordinates

I am looking for the fastest way to convert WKT or geojson geometry from string to numpy array of coordinates. Is it possible to do it strictly in Python and without creating geometry object such ...
1
vote
1answer
591 views

Installing pandas with Esri's python?

Trying to get pandas to import, but I'm getting what looks like an error caused by a failed dependency of the version of my Esri-provided numpy's compile, based on this stackoverflow posting. Here's ...
5
votes
0answers
278 views

Save fails on raster object created from NumpyArrayToRaster [closed]

I am trying to save an ESRI grid built from a numpy array and am getting an error I've never seen before: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ...
0
votes
0answers
64 views

Read esri shape point data and spline interpolation using python shell scripts?

I am quite new in python scripting. I am a dedicated user of arcgis but this time I have to work without arcgis. I have a point shapefile with 10 different attribute fields of different peat layer ...
3
votes
1answer
492 views

How to change value of an individual pixel using arcpy?

I want to change the value of an individual pixel in a raster using arcpy. The code I wrote for changing the value is below, but it changes all of pixels in my raster. How can I set an individual ...
7
votes
1answer
254 views

Why is matplotlib installed with ArcGIS?

Today I upgraded to ArcGIS Desktop 10.2.2 as well as the 64-bit background processing tool and noticed that both numpy and matplotlib were installed with Python. In fact, in the "What's New?" section ...
1
vote
1answer
121 views

gdal_proximity distance to meters

I followed the answer given in this topic for searching the distance to the nearest coastline given a lat/lon coordinate. The distance output obtained is in degree (I think) but I need the distance ...
4
votes
1answer
432 views

XYZ Clustering in Python and numpy arrays

I am looking for a method of clustering XYZ data in Python that works on numpy arrays. I know of a few sources, such as clusterpy and Pysal but have had little success with them as they seem to still ...
0
votes
1answer
306 views

Print last digit in Numpy Array [closed]

I'm sure this is pretty basic, but is there a way to print a certain indexed portion of each segment in an array? For example, if I have the numpy array: ([1,2,3], [4,5,6], [7,8,9]) I'd like to ...
5
votes
2answers
396 views

Creating numpy.array with variable number of fields to test arcpy.da.ExtendTable performance?

There was an ArcPy Café blog posting entitled Adding Fields: Performance Tips which advocated: Two approaches to help increase performance when adding numerous fields to a table or feature ...
2
votes
2answers
198 views

How to calculate monthly maximum values from daily data in a 365 band grd?

I have a MINT2005.grd file which has 365 bands representing days of year from 2005. Each band is a 32x35 matrix representing the temperature at different latitude and longitude pair. How do I ...
5
votes
3answers
195 views

How to get QGIS to play with pandas (Windows)?

has anybody been successful getting pandas to work with QGIS's Python installation, on Windows? I've used the OSGeo4W installer to install QGIS2.2, which comes with Python 2.7 and Numpy 1.5.1. Any ...
0
votes
1answer
304 views

Iterative raster calculation script using NumPy arrays breaks after ~10 rasters, returns: “TypeError: Cannot create raster for numpy array.”

Here is my code: #Generate Cumulative Thresholds #5/15/14 import os import glob import arcpy import numpy as np #Enable overwriting output data arcpy.env.overwriteOutput = True ...
1
vote
1answer
334 views

Raster calculation in for loop returning exit code -1

I've put together a python script that does some calculations on rasters by converting them to NumPy arrays, doing the math, then converting them back to Raster and applying all the same spatial ...
0
votes
0answers
70 views

Import GRD and count days with temperature below zero, using python

Minimum temperature of a year is given in GRD file. I have to read that file and then calculate the frost day (less than zero degrees celcius) from it in python.
3
votes
2answers
232 views

Memory and Processing Efficient Approach to Read a Timeseries in Python

I am trying to store a timeseries of high resolution raster images containing NDVI values into a dictionary for calculations. I am curious as to which approach may the most efficient when loading ...
0
votes
0answers
163 views

No data appears when using gdal_calc.py but source had data values

I'm in the process of calculating topographic exposure using a mix of GDAL, grass, R and python in Windows. I need to process a very large tiff file using the following calculation: ...
-2
votes
1answer
439 views

QGIS converting to ASCII question

I am attempting to do some analysis on a raster file and I need to convert it to ASCII. In QGIS, I used [Raster -> Conversion -> Translate] with the asc file format, and I suspect it is simply ...
1
vote
1answer
722 views

Convert polygons in shape file to a numpy array?

I have a shape file containing a number of polygons and all attributes being text. I'm trying to import the polygons into numpy as an array where each polygon is represented as unique values. I ...
1
vote
3answers
2k views

Is it possible to open rasters as array in NumPy without using another library?

I know that it is possible to open a raster as an array in NumPy using GDAL, but I want to skip GDAL and use NumPy only, as it is cooler handling rasters with NumPy as matrices. There is a similar ...
11
votes
3answers
647 views

How to convert LAS file to numpy array?

I have begun learning how to manipulate LAS data in python and wanted to see how others handle LAS files. I would like to read the points (I am using a numpy array), and filter out classes 1 and 2 ...