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
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 ...
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'...
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 ...
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
896 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 ...
7
votes
2answers
845 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,...
7
votes
3answers
5k views

How to get count of non-NA raster cells within polygon using R

I've been running into all sorts of issues using ArcGIS ZonalStats and thought R could be a great way. Saying that I'm fairly new to R, but got a coding background. The situation is that I have ...
7
votes
2answers
454 views

Is there an open-source equivalent of ArcGIS “Zonal Statistics as Table” tool?

With ArcGIS zonal statistics as a table I can easily calculate the mean value from a raster contained within a polygon from a shapefile. I now have a Mac, and therefore I cannot access ArcGIS anymore. ...
7
votes
1answer
165 views

Compute zonal statistics for portion of polygons

I am working with a shapefile containing the district polygons of the political map of India and a raster file containing the elevation data of the same country. My goal is to compute the average and ...
7
votes
3answers
809 views

How to use ZonalStats plugin?

I am using QGIS 1.8.0 on a Windows Home Premium 7 machine. I have a single band TIFF that is 187 MB in size. My vector polygon shapefile represents a regular grid of a 147x112 36kmx36km grid cells. ...
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 ...
7
votes
1answer
756 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 ...
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 ...
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). ...
6
votes
3answers
766 views

Wrong min value from ArcGIS 10.4 zonal statistics as table

I used the zonal statistics as table tool in ArcGIS10.4 to calculate SRTM, the in_zone is a gridded shapefile, the in_value_Raster is the SRTM extracted for the region as in the image (90m x90m). The ...
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 ...
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 ...
6
votes
1answer
797 views

Compute separate Zonal Statistics table for one raster, zones are many polygons in shapefile

Seems earlier ArcMap versions made this possible: I have one raster (pixels are landcover classes) and a set of buffers stored as multiple polygons (possibly overlapping) in a polygon shapefile. ...
6
votes
0answers
559 views

Zonal Histogram Output Problems - No values associated with the habitat type [closed]

I have a outline of some islands (shapefile or raster) and GAP landcover data (raster). I am trying to use Zonal Histogram to create a file with a histogram of the habitat types in each island. Each ...
5
votes
3answers
567 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", "") ...
5
votes
1answer
152 views

Getting zonal statistics of polygons not touching center raster cells in PostGIS?

I'm working a postgis processing zonal stats from raster and I couldn't manage the problem of raster with so low resolution (like 9km width) and small polygons. My problem is, these rasters are big (...
5
votes
1answer
102 views

Zonal statistics - computation time issue with assigning zones

I would like to upscale a 1/360 degree resolution raster (64800 x 129600) to a 1/12 resolution raster (2160 x 4320) by assigning to each cell in the low-res raster the number of cells in the high-res ...
5
votes
1answer
908 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") ...
5
votes
1answer
287 views

Zones missing after running zonal statistics in ArcGIS Spatial Analyst?

I have a problem using zonal statistics in ArcGIS. My raster contains values/data with 30m cells. I had several vector layers, containing administrative subdivisions of Belgium. I have converted the ...
5
votes
1answer
515 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 ...
5
votes
1answer
967 views

QGis Zonal Statistics Plugin NoData included in Calculations

I have been trying to use the QGIS zonal statistics plugin. My raster has a nodata value of -99999 and all other values are positive. After computing the mean zonal statistics there are a number of ...
5
votes
0answers
120 views

Calculating Mean and Sum in QGIS Zonal Statistics? [duplicate]

When a polygon intersects more than one pixel, and each pixel within the polygon occupies a different area, does the mean take into account the area of each pixel and its correspondent value (i.e. ...
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 ...
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. ...
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 ...
4
votes
1answer
140 views

QGis raster categories proportion per polygon

I have a raster layer of landuse and a vector layer of areas of interest. I would like to calculate for each polygon (areas of interest) the proportion or number of cells of the raster for each ...
4
votes
1answer
358 views

Zonal statistics for millions of polygons

I have a shapefile with 31 million polygons and I want to extract statistics from a raster for each polygon. Whenever I use zonal statistics I get: ERROR 999998: Unexpected Error. Failed to execute (...
4
votes
1answer
128 views

Zonal statistics discrepancy between ArcGIS Desktop versions?

I've discovered a weird phenomenon using zonal statistics with a colleague at another office. We are attempting to use the Zonal Statistics as Table tool to sum the value of raster cells within ...
4
votes
1answer
560 views

Is there an issue with Zonal Statistics calculating wrong mean values?

I tried to solve the following issue by myself but without success. On the one hand I have a raster file which is the result of the processing "shapes to grid" tool. On the other hand I have a ...
4
votes
1answer
427 views

Any way to perform zonal statistics on column other than value or do reclass faster?

I have to perform ArcGIS zonal statistics on a raster, but the column I am interested in is not the 'value' column. Now, I can reclass the raster so that the column of interest becomes the 'value' ...
4
votes
0answers
311 views

QGIS Zonal Statistics for polygons is missing results?

I am carrying out an analysis using QGIS 2.14.1 where I am dealing with point data that have been randomly displaced by either up to 2 Km or 5 Km. I have generated a buffer of the appropriate radius ...
4
votes
0answers
756 views

Zonal Statistics tool not working with QGIS?

I wanted to try the QGIS 2.14 zonal statistic tool but it doesn't work.The system says: not a sequence See log for more details The SAGA Zonal Statistic tool works fine. It also doesn't work with ...
4
votes
0answers
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 ...
4
votes
0answers
308 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 ...
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
1k views

COUNT vs. SUM field of zonal statistics as table output table

I want the count of the number of raster pixels within that polygon. I ran the Zonal Statistics as Table tool using one polygon as the feature zone data and only getting the SUM. I thought it would ...
3
votes
2answers
301 views

“Zonal” Statistics Using Line Features

I would like to find the minimum, maximum and (weighted?) average value of the raster cells intersected by a line (vector) layer. This is similar to what common "Zonal Statistics" tools do, but they ...
3
votes
1answer
149 views

Zonal Statistics is returning null values in ArcGIS Desktop?

I am using Zonal Statistics as Table to obtain the Max height from a DEM for each polygon (then Joined to the polygons). For some reason, a lot of the polygons get NULL returned. All the polygons ...
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://...
3
votes
4answers
539 views

Calculate minimum area where x% of raster value total is concentrated within polygons

I have a raster layer (chlorophyll concentration) and a layer of non-overlapping polygons (regions of the ocean). For each polygon, I'd like to calculate the area where the majority of chlorophyll is ...
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 ...
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
2answers
663 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 <...