0
votes
0answers
11 views

Problem with polygon overlay in raster stats using gdal

I am using the raster_stats module in python to calculate the mean carbon value for different sets of polygons. Here is the code that I am using: africa_sat = ...
0
votes
2answers
56 views

using Python to calculate NDVI, output as a Geotiff

I need a script that can calculate NDVI from two separate input Geotiff files, then output the results as a Geotiff. I wrote following script, most of which is borrowed from various on-line sources ...
3
votes
1answer
25 views

Why is Mosaic or Mosaic To New Image causing a 1-pixel gap between adjacent images?

I have a series of adjacent PNG images, and I'm trying to merge/mosaic them into a single seamless image. The images have clean "cuts" between them, with no overlaps. However, when I use either the ...
2
votes
2answers
62 views

ArcGIS - Extract by Attibutes in Model Builder

I have a model which at one point uses the Extract by Attributes tool to produce a new raster with just the areas containing the maximum values of the first. I would think that the SQL expression ...
2
votes
2answers
32 views

Update raster value to reflect total number of points within cell- python

I have what should be a fairly simple task, but I can't seem to figure out how to do it. I have to do it in python/arcpy/gdal/whatever because I'm trying to automate this process for a hundred or so ...
3
votes
1answer
41 views

How to obtain the width and height of an image using arcpy

This Stack Overflow question shows how to obtain the pixel dimensions of an image using Python. Is it possible to find an image's height and width using arcpy and ArcGIS? arcpy.Describe would seem ...
0
votes
1answer
44 views

Gdal creating raster rotated wrong way

I have been trying to read in a stack of images for a timeseries and created an output raster that contains the max pixel values of the timeseries. The arrays were created using numpy img_stack = ...
2
votes
2answers
51 views

raster standard deviation stretch python script

I am looking for ways of applying a permanent standard deviation stretch to rasters via python script. Are there any arcpy raster stretch functions? I was looking for a reference but could not find ...
1
vote
1answer
30 views

Extract information of a raster overlayed on another raster with a lower resolution directly in python

I have two aligned rasters with the same extent, one has a resolution of 5 meters and the other of 125 meters. I would like to place the 5 meter one over the 125 meter one and assign to these smaller ...
1
vote
2answers
94 views

How to extract X Y coordinates and RGB from pixels using python in QGIS?

I'm trying to white a Python plugin in QGIS (2.2) to get, for each pixel of a raster image, its X Y coordinates, as well as, its RGB (3 bands) values. At first I opened the raster file using: rlayer ...
1
vote
2answers
51 views

Mask image based on no-data pixels in another image with different projection - GDAL or Python

I've got a land cover image which covers the whole globe, and a satellite image which covers a very small part of the globe. These two images have different projections, co-ordinate systems and pixel ...
0
votes
0answers
15 views

Add a raster specifying the projection in pyqgis

I would like add an raster but I want to specify the projection. If I do : qgis.utils.iface.addRasterLayer(url,layerName) QGIS ask me to specify the projection. I want to this with python. How I ...
0
votes
0answers
19 views

Convert raster_stats list output to array / csv file

I usually program in R, but recently I have started to use python for most of my spatial programming. My python skills are still limited, and please excuse the simplicity of the question. I am ...
0
votes
2answers
94 views

Why am I getting 'Error 000732 Raster does not exist'?

I am trying to apply symbology to a raster layer via kernel density analysis. When I run the Python script below in ArcMap, I am get the error message below. I have searched and tried the common ...
2
votes
0answers
58 views

How to display images as cross sections in 3d

I want to display a base map and several vertical cross sections in 3D. The base map image is easy to rectify as a geotiff. How can I also display the cross sections? The cross sections are at ...
16
votes
5answers
481 views

How to buffer raster pixels by their values?

The pixels to the left represent tree locations and their associated crown radii (i.e. pixel values ranging from 2 - 5). I would like to buffer these raster pixels by their crown radius value. The ...
0
votes
2answers
80 views

Can you change the processing extent in environment settings using python to a shapefile?

I have managed to do this manually at Geoprocessing>Environments>Processing Extent and setting the shapefile in the drop down bar. I was wonder if this could be automated with a python script? My ...
1
vote
1answer
60 views

ListRasters not recognizing raster files in python

I have 2 rasters in my workspace, one in TIFF Format and the other in GRID format: "C:\ExampleFolder" When I use the python script: import arcpy >>> ...
1
vote
0answers
47 views

Write raster with its attribute table and symbology

I am classifying lots of rasters and I'd like to automate the legend creation and symbology displaying for easy manipulation. Here is the kind of raster I'm dealing with: library(raster) r <- ...
0
votes
2answers
62 views

Is it possible to alter raster values without Arcpy? [closed]

I'd like to be able to alter raster values, through fairly simple equations, without using the module Arcpy. Is that possible? It seems like gdal, numpy, and rasterlang might make this possible but ...
2
votes
0answers
32 views

Extract MultiValuesToPoints yields identical value for each band

I'm attempting to extract hyperspectral remote sensing data to a point featureclass using the ExtractMultiValuesToPoints ArcGIS tool. The value of each band (228 bands) should be appended as a field ...
1
vote
1answer
28 views

How to read the count of the cells with data with non “no-data” values ,in QGis?

How to read the count of the cells with data with non "no-data" values ,in QGis
7
votes
2answers
181 views

Finding specific pixel values ​​in ArcGIS using Python

I have a raster file containing some integer values. I need to find all pixels whose values are not defined in list like this one: l = [1,2,4,8,16,32,64,128]. Is there any easy way to solve that ...
4
votes
1answer
147 views

How to calculate total number of data cells in raster?

I am using ArcGIS 9.3 and python 2.5. My code is shown at the bottom of this post. I have a raster containing fire intensity information at 200m cell resolution. I run the script and the first count ...
1
vote
1answer
147 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 ...
3
votes
2answers
61 views

Using python to Raster clip the extent to be the same as the display?

I've been trying to figure this out for almost a week now. I am creating a tool which first needs the raster to be clipped out to the current display. I have tried all sorts of things. Below is the ...
0
votes
0answers
35 views

recording pixel value with Python script in ArcGIS 10.x

A scripting newbie question... I'd like to write a Python script for ArcGIS 10.x that would record the pixel value for all pixels in a raster. Furthermore, I'd like to only record a given value once ...
0
votes
0answers
34 views

recording pixel value with Python script in ArcGIS 10.x

A scripting newbie question... I'd like to write a Python script for ArcGIS 10.x that would record the pixel value for all pixels in a raster. Furthermore, I'd like to only record a given value once ...
5
votes
1answer
93 views

Is there a way to find out which pixel values are around the current pixel?

I would like to write a cycle which takes a current pixel, look at the surrounding pixels, choose the pixel with max/min value and skip to that pixel...and so on. Is there in arcpy such a function ...
0
votes
1answer
37 views

Retrieving raster/coverage width and height in pixels from GeoServer

Is it possible to retrieve the original width and height in pixels for a coverage in GeoServer using either the Python API or REST? I could not find anything in the documentation regarding how to ...
1
vote
1answer
25 views

How to build and pass remap for floating point raster without getting Reclassify ERROR 010255?

I am receiving the following message when executing my python script: ERROR 010255: String remap must be used with a string field. My input raster is floating point and I would like to ...
0
votes
0answers
74 views

QGIS 2.0 change the raster band from python command

Does anyone know how to change the band of a multiband raster from the python command line in QGIS2.0? It used to be done with something like rLayer.setGrayBandName(1) in 1.8, but this is no longer a ...
2
votes
0answers
207 views

GDAL polygonize lines

I have a raster file containing roads (left image). I polygonize the raster file with GDAL (see the script below). In the end I like to have vector lines. However GDAL only gives me something like ...
1
vote
1answer
119 views

GDAL polygonize only certain raster values

I want to polygonize a raster file with GDAL. I only want to rasterize cells with a value of 0. Is it possible to specify that within the polygonize function or do I have to modify my raster before ...
2
votes
1answer
99 views

Arcpy.GetRasterProperties_management values do not match values found via ArcCatalog or ArcView

I am using Arcpy to extract the mean and standard deviation values of tiff Landsat satellite images and I get very high values. Values in the thousands rather than in the low hundreds! If I look at ...
1
vote
0answers
24 views

Map algebra from QGIS python console? [duplicate]

What command do I use to do map algebra on rasters from the QGIS python console?
0
votes
1answer
70 views

How to add raster data to Table of Contents using python?

I can easily add shapefiles to the Table of Contents in Arcmap using the following codes: mxd = arcpy.mapping.MapDocument("current") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] path = ...
1
vote
3answers
284 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 ...
2
votes
2answers
606 views

Loading PostGIS raster layer into QGIS

I am unable to load a PostGIS raster layer into QGIS. I have looked through previous posts Loading raster from PostGIS DB into QGIS and Cannot add the PostGIS raster layer with QGIS but was not able ...
1
vote
0answers
78 views

GDAL and Python: How to “pad the extent” or otherwise handle band.ReadRaster() for area falling slightly outside the image bounds?

In a nutshell, I'm trying to create a bare-metal tiling utility using GDAL and Python. As you can see in the graphic below, which shows the perimeter of a raster and the OSM-structured tile index, ...
1
vote
1answer
75 views

Raster Smoothing python [duplicate]

I want to perform raster smoothing on a DEM file. I want to to assign the elevation of each pixel using the average elevations of its 8 neighbors. The ESRI's "Python scripting for ArcGIS" has a ...
2
votes
0answers
166 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 ...
3
votes
2answers
139 views

Calculating Z-scores in Arc

I am trying to take the natural log and then calculate z-scores on cell values in several composite band GRID rasters in Arc. I am not fluent in python and do not see a way to automate this within Arc ...
1
vote
0answers
96 views

python.multiprocessing and “FATAL ERROR (INFADI) MISSING DIRECTORY”

I have a question which is closely related to this old question here: python.multiprocessing and "FATAL ERROR (INFADI) MISSING DIRECTORY" I have also looked at this, which seems to relate ...
2
votes
0answers
106 views

How to convert a raster (array) to a NetworkX graph and do a * search?

I want to use a slope-raster for a a_star path analysis in NetworkX. I am using Python for this project. My test raster looks like this First I read in the raster with GDAL input_raster = ...
0
votes
0answers
55 views

Using arcpy.GetRasterProperties_management gives strange results

I have a loop which goes through folders and do some raster operations. Inside this loop I checked for a raster properties using arcpy.GetRasterProperties_management with NODATA parameter. And then ...
0
votes
1answer
115 views

Problem with converting rasters to arrays and adding them to main array, then converting to raster via NumPyArrayToRaster : output is NoData values

I have a process that aims to loop through a list of rasters (testing with only 3) covert each raster to an array, add the array to an existing 'template' array, then save the final array back to a ...
10
votes
6answers
464 views

How do I iterate through every cell in a continuous raster?

See this link for more details. The Problem: I want to loop through a continuous raster (one that has no attribute table), cell by cell, and get the value of the cell. I want to take those values ...
0
votes
2answers
311 views

How to extract subdataset from HDF raster?

I am trying to extract a subdataset from HDF raster. Later on, I intend to make operations such as mosaicking and extracting raster averages from the extracted subdataset. The following code is ...
1
vote
0answers
82 views

Modifying Raster Layer with Python Console

Forgive me if this has been asked somewhere else. I am looking for a way to edit a raster file which has already been loaded into QGIS through the python console (i.e. I would like to edit the raster ...