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).

Filter by
Sorted by
Tagged with
4
votes
3answers
7k views

Iterate through multiple Raster files and compute statistics using Zonal Statistics

I have a large number of raster images. What I'd like to do is to compute statistics on different sections of these raster files using a polygon. I think everyone is suggesting Zonal statistics. ...
7
votes
2answers
788 views

How does QGIS Zonal Statistics handle partially overlapping pixels?

There are a couple Stackexchange posts asking this question, but neither of them were sufficiently answered: How does Zonal Statistics work exactly? How does Zonal statistics handle pixels that are ...
9
votes
3answers
7k views

Using QGIS Zonal Stats Plugin from Python Console?

I am using the Zonal Stats plugin in QGIS to extract raster statistics from overlaying polygons (I have shapefiles of species distribution and I want to extract environmental data from within each ...
25
votes
3answers
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 ...
5
votes
3answers
564 views

Some zones disappear when running Zonal Statistics as Table in ArcGIS

I'm new to GIS. I want the sum of nighttime lights (DMSP) by district for some country. I'm running this arcpy.gp.ZonalStatisticsAsTable_sa(Limites_distritales, "IDDIST", rc, temp_table, "DATA", "") ...
6
votes
2answers
3k views

Zonal statistics for millions of overlapping polygons in ArcPy?

I am running ArcGIS 10.1 with 64-bit GP on Windows 8.1 x64. I want to calculate the zonal statistics of buffer polygons based on parcels and a kernel density raster. The 4.7 million polygons overlap ...
10
votes
2answers
9k views

How does Zonal Statistics work exactly?

I'm a bit confused on how the zonal statistics tools work in QGIS (either the 'Zonal Statistics' tool under the Raster tools from the QGIS geoalgorithms toolbox or the 'Raster statistics from polygons'...
4
votes
2answers
1k views

How to Calculate Custom Zonal Statistics?

I have a vector polygon shapefile outlining counties for which I have a raster of nighttime-luminosity data. I've been able to compute Zonal Statistics in ArcGIS 10.0 using Zonal Statistics as Table ...
6
votes
2answers
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). ...
2
votes
0answers
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 ...
7
votes
2answers
5k views

Issue Trying to create Zonal Statistics using Gdal and Python.

I am trying to create zonal statistics using Python and Gdal. I have a polygon shapefile and a raster file, and in order to do so, I am using a piece of code I found in StackExchange. The raster and ...
7
votes
2answers
895 views

Robust Zonal stats in R and QGIS

Comparing results of zonal statistics in QGIS and R, I noticed that the results they both yield do somehow differ. Manually checking, I also found that both QGIS and R seem to partly produce erroneous ...
3
votes
1answer
1k views

Finding local maxima with variable window search using ArcGIS Desktop?

I would like to find local maxima in different zones of raster file. I got five zones (zone 1, 2,3,4,5) and would like to find local maxima with different window search for each zone in arcgis ...
2
votes
1answer
1k views

Calculating NDVI per region, month & year with Google Earth Engine?

I want to calculate the mean NDVI per region (admin level 3, also called woreda), month and year. So my end result would look something like this: regions year month NDVI ------------------...
0
votes
2answers
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 ...
6
votes
1answer
575 views

How are raster pixels determined whether they are in or out of a zone?

I just needed to confirm something that I think I already know the answer to because help pages are always unclear. I am running ArcGIS 10.2.2 and often use the Zonal Statistics and Tabulate Area ...
7
votes
2answers
844 views

Alternatives to Zonal Statistics which include partial pixels (QGIS)

The task I want to complete is essentially exactly what the Zonal Statistics plugin for QGIS aims to achieve: gives statistics about the values of a raster layer in areas defined by polygons. However,...
4
votes
2answers
172 views

Clustering 30m pixels into 120m pixels, fishnet using QGIS?

I have a raster file representing tree cover loss made of 30m*30m pixels taking the value 0 or 1. 0 means no loss and 1 means tree cover loss. I want to cluster these pixels into bigger pixels of the ...
4
votes
3answers
1k views

How can I determine which raster attribute covers the highest area of a polygon?

I'm relatively new to GIS and QGIS but I have a problem that I'm not certain how to solve. I searched here for relevant information but found none. (Or, I used incorrect search terms.) My problem ...
3
votes
2answers
169 views

Expected result for ZonalStatisticsAsTable MEAN Statistic Type?

I'm getting different results when using the ZonalStatisticsAsTable tool in 10.4.1 when compared to earlier versions (10.2 and 10.3). ArcGIS 10.2: ArcGIS 10.3: But in ArcGIS 10.4.1, the same data ...
2
votes
1answer
588 views

Running QgsZonalStatistics in PyQGIS script?

I have experienced a very bizarre issue with my PyQgis code. I simply want to load a raster and a vector layer to do zonal statistics, the first part works perfectly but for the zonal statistic I have ...
6
votes
1answer
246 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 ...
4
votes
0answers
256 views

How does Zonal statistics handle pixels that are on border of polygon? [duplicate]

I am using the plugin zonal statistics to calculate the sum of the raster cells within polygons. How does this plugin handle pixels that are on the border of the polygon, are those cell values ...
4
votes
4answers
8k views

How to read this data file and convert it to raster format for analysis?

I am trying to introduce the 5 degree dataset from here http://www.cru.uea.ac.uk/cru/data/precip/ (it is the first link). And once I introduce it to GIS to use it as a raster input to calculate zonal ...
3
votes
1answer
412 views

Getting Zonal Statistics of Overlapping Circles?

I have a Buildings (polygon) shp file and a DSM. what I wanted to do was to get the pixel values for all the vertices of those buildings, and find another pixel value just around those vertices (say ...
3
votes
1answer
199 views

Appending 10,000 tables using ArcPy?

I am trying to append ~10,000 tables together using an ArcPy script. I believe the method I am using does not work as the script is attempting to append too many tables at the same time. Would a ...
3
votes
2answers
662 views

Plotting and analyzing extracted elevation data in R?

I have a shapefile of county boundaries for New York state and elevation data downloaded through the elevatr package. library(elevatr) library(raster) library(sf) library(USAboundaries) counties <...
3
votes
2answers
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 ...
3
votes
1answer
199 views

Zonal stats for complete pixels qgis

I am trying to extract zonal statistics from raster imagery using polygons in QGIS 3.2.1, but I only want to use values from those pixels that are completely included in the polygons, ¿how to do this? ...
3
votes
2answers
963 views

Problem with calculating QGIS Zonal Statistics MEAN

I need to calculate some zonal statistics from raster files for some polygons in a shapefile. I am using the following code which works: eligibleLayer = QgsVectorLayer("/home/usr/Desktop/...
3
votes
2answers
372 views

QGIS Zonal Statistics returns empty?

Does anyone familiar with the QGIS Zonal Statistics tool know why stats calculations might return empty? Inputs DEM for South Carolina: http://dnr.sc.gov/GIS/descdem.html A vector shapefile: https://...
2
votes
0answers
734 views

QGIS 2.4 Processing (Zonal Statistics) error [closed]

In QGis 2.2 all my models (processing model builder) are working fine. When I start the same models in 2.4 I get errors like this: Prepare algorithm 5: Zonal Statistics Running Zonal Statistics [...
2
votes
1answer
506 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 (...
2
votes
1answer
467 views

QGIS equivalent to the ArcMap Zonal Statistics as Table

Is there a QGIS equivalent to the Arc: Spacial Analyst: Zonal: Zonal Statistics as Table? Given the USDA Cropland Data Layer, Would like to count the pixels by type within a county.
2
votes
3answers
477 views

Zonal Statistics as Table Tool

I have a slope dataset. I have a polygon shapefile with territory within the extent of the slope map. I have to calculate the real surface area of this shapefile using the zonal statistics as table ...
2
votes
0answers
114 views

Zonal sum gives incorrect results [closed]

I have two raster files: Raster 1 has 7974 grids (coarser resolution) with Rowid, Value and Count. Raster 2 is finer resolution and each grid has values either 1 or 0. What I want to do is to find ...
2
votes
0answers
315 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 ...
2
votes
1answer
2k views

Using Zonal Statistics As Table for overlapping polygons in ArcPy?

I'm using ArcGIS 10.2 for Desktop and would like to calculate the population within a specific distance from bus stops. My input layers are: census block (polygon) with population undissolved bus ...
1
vote
1answer
1k views

Writing result of PyQGIS to shapefile

I try to perform some zonal statistics on a shape- and rasterfile and write the output to a completely new shapefile! import sys # where is the module sys.path.append("/Applications/QGIS.app/Contents/...
1
vote
1answer
91 views

Zonal statistics using Python console in QGIS gives AttributeError?

Here is how the log shows for one raster image. I want to do this same thing for several rasters. The batch processing is not working. QGIS version: 3.8.0-Zanzibar QGIS code revision: 11aff65f10 Qt ...
1
vote
3answers
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 ...
1
vote
2answers
723 views

ArcGIS Multiband Raster [duplicate]

I know this has been asked and answered here but since I don't have enough rep to ask a clarifying question to the person who answered it I am having to post a completely different question. I am ...
1
vote
2answers
4k views

What to do when raster cell size is larger than zonal vector feature in order to collect statistics?

I am trying to extract the mean cell values for a raster dataset based on a survey grid polygon feature using ArcINFO 10.1. The cell size of the raster dataset is about 4 times the size of the survey ...
1
vote
1answer
1k views

Python Script Zonal Stats as Table Loop Question

I'm trying to write a small script loop script which retrieves rasters from each folder, performs zonal statistics using watershed polygons and saves it as a table. I've written similar loop scripts, ...
1
vote
1answer
458 views

Polygons too Small for Zonal Statistics

In ArcMap, Zonal Statistics uses the centre points of the Rasters pixels to link to the under or overlying polygons. Some of the polygons that I am using are small enough that they do not overlap ...
1
vote
1answer
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-...
0
votes
2answers
307 views

Calculating Centroids with Zonal Geometry in ArcGIS

I have a shapefile containing polygons. Each polygon is defined by its postal code. I want to calculate the centroid of each polygon using Zonal Geometry. Sadly, for some polygons there are no ...
0
votes
1answer
66 views

Multiple Output for Zonal Statistics as Table [closed]

I am trying to merge NDVI data from 2005 to 2018 (two .tif per decade) with a region land use. For this, I have used "iterate rasters" with 36 of .tif I'll be using, as the 'Input value raster' of ...
0
votes
1answer
1k views

Zonal Statistics As A Table missing Features in Results?

I have a point shapefile that includes parcel centroid features across a county in Pennsylvania. I am trying to get a sense of the percentage of forest land within half-mile and mile buffers around ...
0
votes
1answer
212 views

Zonal statistics results in some NULL values in QGIS?

I used zonal statistics through QGIS to assign raster image values to polygons. Here, Raster image has value in range from 0 to 238.567. As a result, some NULL values are assigned to polygons, even ...