NumPy is a Python module, 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

5
votes
1answer
133 views

Optimizing Python GDAL ReadAsArray

I am using the GDAL ReadAsArray method to work with raster data using numpy (specifically reclassification). As my rasters are large, I process the arrays in blocks, iterating though each block and ...
4
votes
1answer
202 views

Tabulate Area using GDAL and Numpy

How could I perform a Tabulate Area using GDAL and Numpy? I am trying to summarize how many pixels of each class in a Landcover raster are within each polygon of a Census Blocks shapefile. I've ...
1
vote
1answer
261 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 ...
3
votes
0answers
46 views

GDAL RasterIO performance in C++ vs ReadAsArray in python/numpy

I'm currently writing optimisations for a raster viewer program which uses gdal as it's base. It's currently written purely in python, and has some major speed issues which cause problems when we are ...
3
votes
0answers
526 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] ...
3
votes
0answers
500 views

Buffering a Raster with GDAL and Numpy

I am using GDAL to convert a raster dataset into a numpy.array and then using numpy to buffer the data in the raster. For example, I need to know all the regions within 100ft of a school point ...
2
votes
0answers
79 views

arcpy RasterToNumPyArray causes shift in location of values

I am converting a couple rasters to arrays, then performing calculations on them. First step- polygon to raster. This creates a 1/0 mask that I can multiply the larger raster by. After noticing my ...
2
votes
0answers
528 views

Finding coordinates from a nested grid as a numpy array

So this is a pretty basic question, but I'm trying to figure it out. I've written a script that allows a user to read in a raster and provide a cell resolution, and outputs the amount of cells ...
2
votes
0answers
463 views

How do I use scipy.ndimage.gaussian_filter1d on an arbitrary axis?

I have a GDAL raster that looks like this: And I would really like to blur this raster along an arbitrary transect. I see that scipy.ndimage has a gaussian filter that allows me to blur the raster ...
1
vote
0answers
123 views

Python with ArcGIS: import scikit-learn fails (bad numpy.dtype)

I am trying to install scikit-learn 0.17.1 (current) into my Python 2.7.3 that accompanies my ArcGIS 10.2. The installation through easy_install goes through smoothly, but I get the following error on ...
1
vote
0answers
91 views

Write stacks of GeoTIFF image to NetCDF by chunk size

I converted GeoTIFF image stacks to NetCDF file with writing data by Index order (layer by layer) (this was a main solution). The problem is, it writes slowly (for 25 images - 1Gb takes 90 seconds). ...
1
vote
0answers
90 views

TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.ndarray'

I am trying to insert a value for different group of percentile eg (0- 10 percentitle) value = 1. I saw an example over here and went to try it out How do I Calculate Grouped Percentiles or Batch ...
1
vote
0answers
38 views

Read latitude/longitude to create new point grid at higher resolution

New to SE, needed to reformat my other question. Basically I'm looking at reading a CSV with longitude and latitude points (in this case housing exposure, simplified below): HUC4,Longitude,Latitude ...
1
vote
0answers
695 views

Reading, modifying and writing a geotiff with GDAL in python

I'm trying the learn the ropes of Remote Sensing image processing using Python GDAL bindings and numpy. As a first attempt, I'm reading a Landsat8 geotiff file, do a simple manipulation and write the ...
1
vote
0answers
119 views

How to accelerate my python looping process for A-star path finding on DEM surface?

I try to make an A-star Path Finding program base on tile-graph (image raster data as graph) where each pixel values represent as cost and elevation.. In my case, DEM raster data was called by using ...
1
vote
0answers
87 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
0answers
27 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
0answers
165 views

Efficient computation of path profile with Numpy and GDAL

I have numpy array with SRTM elevation data and I need calculate path profiles - vectors with elevation data from one point (transmitter) to every points of my map. Here's my current solution: def ...
1
vote
0answers
279 views

How to create multi-image single band single file geotiff?

I have a geotiff file that is single band but contains multiple subdatasets. I use gdal with numpy to open a specific subdataset and mask some of its values. Example: $ gdalinfo sample.tif ... ...
1
vote
0answers
279 views

Averaging satellite data with missing values (using Python)

I am using sea surface temperature, chlorophyll, and other data parameters as covariants in a model, and I would like to average them over a particular time period. I am currently doing this using a ...
1
vote
0answers
388 views

ValueError when reading a raster band as a numpy array

Here's the problem shown in Python shell: In [32]: from osgeo import gdal In [33]: geotiff = '/Users/calvin/work/luc/proj_public/media/GLO ...
0
votes
0answers
30 views

numpy.unique: ValueError: all the input arrays must have same number of dimensions

I'm trying to get the unique values of an array but am getting an error that doesn't make any sense. Here is my pseudo code: import numpy as np import gdal # I have a .tif file, call it ...
0
votes
0answers
49 views

Create raster with decibel value from Geotiff Intensity using QGIS GDAL python

I have raster with intensity values and I want to create raster with decibel values, I work with QGIS GDAL, I use gdal_calc I do this from the terminal: gdal_calc.py -A input_image.tif ...
0
votes
0answers
23 views

Using numpy.dstack() for merging two 3D arrays but losing spatial reference.

The code is as following: >>> temp = numpy.dstack((spi_negative,spi_positive)) >>> >>> temp.shape (16, 126, 294) >>> out_ras = ...
0
votes
0answers
42 views

return _NumPyArrayToRaster(*args, **kwargs) ValueError

I am trying to make an array to raster from the defined array below. However, I keep getting this error: return _NumPyArrayToRaster(*args, **kwargs)ValueError: Argument in_array: A two or three ...
0
votes
0answers
28 views

More pythonic approach to resolution increase of point locations

Excuse my first question being slightly more Numpy and less actual GIS, but it relates to latitude / longitude so I thought I'd give it a shot. Problem: I have a flat file with latitude and ...
0
votes
0answers
387 views

Convert Raster to Numpy Array with only Arcpy and Numpy

All the articles I'm finding including GDAL or PIL(?) which I cannot use. So I am trying to convert a raster I have to a Numpy Array with Arcpy and Numpy and then calculate some statistics on it but ...
0
votes
0answers
162 views

stack raster using GDAL and numpy dstack

I am testing Savitzky-Golay filter with my MODIS dataset. Currently I am testing for 10 rasters (but later on will use my whole dataset) only just to test how should I create my script. So my initial ...
0
votes
0answers
111 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
0answers
274 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 ...
0
votes
0answers
140 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.
0
votes
0answers
261 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: ...