# Questions tagged [zonal-statistics]

Zonal statistics summarize the values of one raster within the zones of another dataset (either raster or vector) and output the results as a raster (for a single statistic) or table (for multiple statistics).

330 questions
Filter by
Sorted by
Tagged with
917 views

### Counting raster values using another raster as mask in R?

I would like to count the frequency of values in one raster, using another raster (different resolution) as the zonal condition. The premise is that the coarser resolution raster represents the area ...
42 views

### zonal statistics / join with two vector layers [duplicate]

I have a shapefile containing three polygons of river basins with different values. I want to know the average values per country. The country thus contains three river basins. When I use join in ...
307 views

### Calculate average value of a raster, that is clipped by multiple polygons? [closed]

I have a raster of coherence value (SAR interferometry) and a land use shape. I wish to calculate mean coherence value for those areas with a specific land use. I split land use shape into specific ...
489 views

### QGIS Zonal Stats Plugin - Python Console - compute one specific statistic

I think this is more of a syntax problem that I have here. But I am absolutely not able to figure it out. On a different Linux machine I got the following working: zoneStat = QgsZonalStatistics (...
145 views

### Making zonal analysis faster?

I created this python script which performs zonal analysis for the 100m, 200m, 300m, and 400m surrounding a list of points. It works but I have two main problems: A) The raster I am processing has ...
819 views

### Geopandas and Zonal Statistic error

I'm trying to use Geopandas and zonal statistic from rasterstats together. I run this code import geopandas as gpd from rasterstats import zonal_stats geodf = gpd.read_file("SHP/shape.shp") ...
480 views

### How to compute zonal statistics fast?

I have 12000 circles with a radius of 50 miles on a raster with 0.05 degree resolution. Global analysis. The raster is 32 bit float and I have to calculate zonal statistics for 20 different rasters. ...
454 views

### python code multirasters zonal statistics

env.workspace = "C:\Users\\Documents\pythonMODIS\extract" # Set local variables inZoneData = "mask.shp" zoneField = "Classes" inValueRaster = "mi1511171_clip.tif" outTable = "zonalstattblout02.dbf" #...
310 views

### Zonal Statistics on discrete values in raster using ArcGIS for Desktop?

I am using ArcGIS 10.3 for Desktop. I am using Corine Land Cover raster data for Southern European Countries, this data gives discrete values to particular land uses (e.g. 1 = agricultural land, 2= ...
766 views

### Correcting Errors in Height Above Nearest Drainage (HAND) model

I have used this tread Spatial Analysis - Calculate a cells elevation (height) above the nearest stream cell to create a HAND map in ArcGIS. First I used the hydrology toolset to fill in sink in the ...
1k views

### Zonal statistics of polygon overlays in PostGIS

I am trying to do a seemingly simple task -- extract mean pixel values from a raster based on a polygon overlay in PostGIS. I consulted several sources, including this blog, this blog, and this post). ...
453 views

### Too many zones for Zonal Histogram?

I have 45 tif tiles each of 20-50MB and a single shp file with about 4000 polygons. I want to run zonal histogram in Arcmap 10 to get the number of pixels with each value for each polygon. If I ...
450 views

### Determining Min and Max elevation in Python using GDAL? [closed]

I have a DEM file and shapefile of specific area, and I want to Create a module in Python that writes name of each area which is shown in the picture, with the greatest differences in altitude on the ...
589 views

### Changing processing extent with each iteration using ArcGIS10 ModelBuilder [closed]

I have a very large raster for which I am trying to compute zonal means using a shapefile that covers the same extent but has hundreds of thousands of individual polygons as zones. Trying to just use ...
154 views

### Resampling gives higher MEAN when using zonal statistics

I am using ArcGIS 10.1 for Desktop. I have a value raster and a polygon feature in GCS coordinates. My raster resolution is 0.5 decimal degrees which is much larger than the size of my polygons. My ...
71 views

### Best way to store, elaborate and query raster data [closed]

I have created multiple raster images with GRASS-GIS (~150Gb), that I'll need to multiply for a certain coefficient, and query the results that need to by saved just temporally. The portions of the ...
135 views

### Zonal Statistics Python Code

I'm trying to calculate the number of certain raster cells within the individual buffers identified by the FID and I'm not sure what else I need to change in this code to make it run: # Import system ...
722 views

### Weighted zonal statistics in Python and/or R [closed]

I have raster files with precipitation data (4x4 km), monthly, for about 100 years. I have a shapefile for a watershed (which includes several polygons as sub-basins). I need the average precipitation ...
752 views

### Zonal Statistics as table produces wrong result (only one row of result)

I have temperature as a raster file and different ZIP Code Tabulation Areas (ZCTAs) as polygons. I'd like to calculate the mean temperature per zip code. I need to know the temperature value per ZIP ...
235 views

### Does zonal statistics do weighted average?

When I compute mean using zonal average in ArcGIS, is it taking into account the 'COUNT' in the value attribute table? e.g. if I have a raster with VALUE COUNT 1 10 2 20 3 ...
76 views

### Distinguishing Road Network according to the ward within a municipality ArcGIS

I have a polygon layer of a municipality containing 14 wards as shown in figure i. I also have a polyline layer of road network irrespective of the ward. The road network have following attributes - ...
76 views

### How to remove negative values from a created HAND model

I have used ArcGIS to create a HAND (height above nearest drainage) using an SRTM DEM. However, some small portions have negative values in the model which is supposed to have zeros as the minimum ...
2k views

### Batch Zonal Statistics as table?

I want to calculate zonal statistics as table for multiple rasters, but can't figure out how. What I am trying is: import arcpy, os arcpy.env.workspace=r'F:\Sheyenne\Atmospherically Corrected ...
1k views

### How does ArcGIS calculate zonal statistics with multi-band rasters?

I am working back and forth between QGIS to ArcGIS for various tasks. So far, for my task, I have found similar tools and options between them. However, for my current task, to calculate the zonal-...
99 views

### Zonal statistics as table fails using Geoprocessor and C#

The above code snippets fails while calculating the Zonal statistics as table using Geo processor in C#, butit works in ArcMap. Any ideas where/what I did wrong?
369 views

### Error using zonal statistic [closed]

I'm using 2.8.1 QGIS version (Wien) and I have a raster layer with FWI values and a vector with district polygons. What I want is to calculate the mean pixel FWI value per district. I know the ...
90 views

### Zonal Statistics doesn't work after updating processing (2.10.2)

After updating the processing tool zonal statistics doesn't work. in method 'SpatialReference_ImportFromProj4', argument 2 of type 'char * Could someone else try if it's a bug or just an issue on ...
1k views

### How to get pixel values of indvidual pixels falling under a poygon to shapefile attribute table or CSV?

I want to be able to write pixel values of each pixel falling under a polygon onto a polygon attribute table or a CSV. I have about 1200 polygons and a georefernced GeoTiff file with NDVI values. ...
187 views

### How to calculate zonal statistics of buffer zone with minimum distortion

I want to create 50km buffers around a large set of polylines that have a global extent. My objective is to calculate average raster values within each buffer zone. The matter of confusion: I want ...
72 views

### Use zonal statistics for only some part of input shapefile

I have a district shapefile (districts have different size) and a raster file of precipitation (18 km grid square resolution). I want to calculate precipitation for each district which I did using ...
57 views

### Zonal statistics shifted

I am working with QGIS (newbie). I have a raster map with 0.5degrees resolution. I created a 0.5degrees width grid layer and I compute zonal statistics from the raster. My problem is that it seems to ...
303 views

### Weighted averages: accounting for grid cell surface variation in proportion to the cosine of its latitude [closed]

Non-geographer learning GIS here. I'm using ArcGIS Desktop v. 10.2.2. I have a 30-arc second Terrain Ruggedness Index (TRI) raster file, and I want to measure the average ruggedness within each ...
4k views

### Major bug in ArcGIS Zonal statistics?

Update: The bug has been fixed in the ArcGIS 10.4 release I am using ArcGIS 10.2.2 to determine zonal statistics for a number of zones. If there is any NoData in the value raster, I want the zone ...
45 views

### Using zonal statistics in ArcGIS for Desktop?

I have a set of temporal images of a given State with 23 districts. When I used ArcGIS for Desktop to generate zonal statistics using the vector file of the State, the pixel counts were tabulated ...
222 views

### Zonal average weighted by distance from point

I am using ArcGIS 10.2. I have a vector layer with points, which represent houses and a raster layer with values of 0 or 1, according to a certain threshold. In a buffer of 5 km around each of these ...
239 views

### Zonal maximum at a specific location

I have 50,000 polygon shapefile, each polygon is a small community. I have a flow accumulation raster. I need to extract just the maximum cell (max flow accumulation) for each polygon. Now if I run ...
172 views

### Zonal statistics error: 0-d arrays can't be indexed

How can I fix the error 0-d arrays can't be indexed? This message appears after the tentative to use the algorithm Qgis Zonal Statistics. Detail: the algorithm worked very well several times and then ...
343 views

### zonal statistics sum on raster with same values

I was wondering if anyone knows what exactly zonal statistics sum does if all my input value raster have the same values. For e.g. Lets say I have a finer resolution raster with 10 pixel each having ...
540 views

### Remote sensing Classification and texture analysis compared with QGIS zonal statistics

I am Using Geomatica to analyse suburban spectral signature in Las Vegas. Ran a texture analysis on all band images. Combined texture bands with original image bands to run an unsupervised ISODATA ...
492 views

### Can I use TIFF files for zonal statistics in QGIS or ARCGIS?

I am completing a remote sensing paper and am doing most of the work in PCI Geomatica, where I have 2 separate files. One from running a texture analysis algorithm containing 6 band layers from a ...
188 views

### Rasterstats throwing error: Cannot open as GDAL raster

I'm using the rasterstats zonal_stats function (pip installed), and running it on a .vrt file. Everything runs perfectly in my Ipython notebook, but when I try to run it in my regular python ...
1k views

### Zonal Statistics for multiple rasters

I'm trying to create a timeseries of raster data (one layer per year) by polygon (Administrative regions). Is there any way in QGIS to perform Zonal Statistics for multiple years (without having to ...
2k views

### ArcGIS 10.3 Build Raster Attribute Table fails for large rasters

I am looking at forest loss in Central and South America within protected and unprotected areas. So I have a binary raster (0 or 1) for forest in 2000 and another raster for forest in 2013. I want to ...
1k views

### Zonal computations: computing raster pixel counts within polygons using GDAL versus rasterstats

I'm computing some zonal statistics, and was comparing the results obtained using the GDAL cookbook example code here with the rasterstats zonal_stats function. I want to compute the mean value per ...
483 views

### Accessing bands in .pix (PCIDSK) file in python/arcpy

I am trying to perform zonal statistics on a single band from a multi-band raster in .pix format. I have things working great with a tiff file. I am able to access the bands using this code: desc = ...
1k views

### Zonal Statistics as Table output is missing some polygons ONLY when run from Python script

I have a raster file from which I am attempting to calculate mean values for polygons defined in a shapefile. Using the Zonal Statistics as Table tool from within ArcGIS works great. My shapefile ...
384 views

### RuntimeError opening rasterio array in GDAL

I've opened a GeoTiff with rasterio: import rasterio with rasterio.open('Africa.tif') as src: transform = src.meta['transform'] array = src.read(1) array([[203, 203, 203, ..., 0, 0, 0],...
2k views

### How to define PROJ.4 string for GDAL projection

I'm doing some zonal computations in GDAL using the code posted in the solution here: Issue Trying to create Zonal Statistics using Gdal and Python. It runs fine for me using the example data posted ...