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
0
votes
1answer
143 views

Issues when exporting/zonal statistics rasters from .tif and .nc files

I am trying to aggregate at a 0.1º cell level, using zonal statistics, two variables that come from two different raster files (one in .tif, other in .nc format, links here and here). Both seem to ...
1
vote
0answers
155 views

Calculate river length in each subcatchment

Using ArcGis 10.4 I have suceeded in calculating "maximum upstream river distance to its reach per subcatchment" per subcatchment with the help of this forum (see Calculate river distance to ...
1
vote
0answers
146 views

Calculating built-up density for each cell in vector grid in QGIS?

I have two layers: a raster of India showing built-up areas (black pixels represent built areas) and a vector grid overlaying it. My goal is to calculate the percentage of built-up surface in each ...
0
votes
1answer
668 views

Rasterizing multiple features using rasterio? [closed]

I am trying to apply the rasterio.features.rasterize function in order to obtain a zonal statistics from a vector file containing multiple vectors. Despite my efforts, I have been unsuccessful in ...
1
vote
1answer
566 views

How to extract pixel value counts from a raster in QGIS, in different polygons?

I have a raster with values from 1 - 12 (0 is no data) that has the extent of Sweden. These values represent factors, or categories rather then a numeric value. I would like to know how many of each ...
1
vote
1answer
73 views

Looping script with Zonal Statistics

This is my first time using python in ArcGIS. I have a gdb of about 100 feature classes, and need to get Zonal Statistics for each. I'm using a textbook, and got this so far: import arcpy from arcpy ...
3
votes
1answer
345 views

Automating Zonal statistics in QGIS?

How do I use zonal statistics in the python console to get CSV/dbf output? I have used the code like this: # Python code for Zonal statistics from PyQt4.QtGui import * from PyQt4.QtCore import * ...
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 ...
1
vote
1answer
152 views

Pyqgis: How to take output from Qgs.ZonalStatistics and join by ID with point layer

What I'm trying to do: Extract median by a single polygon from multiple GeoTIFF rasters stored in a folder (Solved) Add each median value to a point shapefile (Match/join by: id column for each point ...
2
votes
2answers
332 views

Python: Extract median by polygon from multiple raster files

What I'm trying to do: Extract median (or 50th quantile) by a single polygon from 558 GeoTIFF rasters stored in a folder What I got so far: Using Python from within Qgis and Qgs.ZonalStatistics I've ...
3
votes
1answer
79 views

Missing 0 values of a Rasterlayer prevent correct calculation with Zonal Statistics tool in Qgis

For my master thesis I want to calculate the mean percentage of sealed surface in some parks of Berlin. For this purpose I have a rasterlayer containing this data. In a previous step I already ...
3
votes
0answers
94 views

Zonal statistics behavior

I have an issue for the result of QGIS Zonal statistics mean values. I expect the value for the polygon marked red (poquoson) is about 26.6 but it seems that it is averaged value over one right ...
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. ...
2
votes
2answers
192 views

Running zonal statistics on multiple raster tiles using QGIS?

I'm new to QGIS (2.18.11). I've got OS Terrain 50 elevation data, in around 150 ASC tiles (10 km x 10 km) covering my whole area of interest (north-east Scotland). There is just a single band. I've ...
2
votes
1answer
169 views

Iterate many raster and many shapefiles in python using the zonal statisitics as table tool

I am pretty new to coding. I have to execute zonal statistics on many shapefiles (~20) for many rasters (~300). Essentially, the first shapefile is used to process all zonal statistics for all ...
1
vote
1answer
34 views

When generate buffer for zonal statistic, how to avoid the neighbor object?

I have a layer of many polygons indicating water area, scattered everywhere. Some of them are very close to another. I want to know what's the slop around the water sites. So I already have a layer ...
1
vote
1answer
258 views

Error 999999 in Zonal Statistics estimation using ArcPy?

I have multiple rasters saved in "Zonal.gdb". All the rasters in "Zonal.gdb" and "TownWilson_PrjUTM" have projected coordinates "WGS_1984_UTM_Zone_15N". I want to clip each raster to the extent in the ...
2
votes
1answer
796 views

Why is ArcGIS Tabulate Area Better to Calculate Unique Landuse Values in Zone?

I am not a formally trained GIS professional nor is GIS a primary tool in my job. And therefore, without an incentive to optimize GIS workflows, I may not understand why one tool, although seeming to ...
2
votes
1answer
153 views

Zonal statistics as a table error code 010429

I am trying to extract majority land-use type from a land-use raster (TIFF, unsigned integer, 30X30 m cell size) into a multipart polygon feature class (which contains ~1300 200-m radium circular ...
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", "") ...
1
vote
1answer
216 views

Arcpy Error 010423 when using Zonal Statistics to Table in a tool

I want to include Zonal Statistics to Table to my tool. But if I do I get the following error: Traceback (most recent call last): File "C:\Users\xyz\Desktop\test.py", line 16, in <module> ...
0
votes
1answer
33 views

Getting map of what cells in raster are contained in different zones of polygon using ArcGIS Spatial Analyst?

I am using ArcMap 10.2.2 with Spatial Analyst. I have a few different gridded datasets describing attributes of a city. All those datasets overlay the same gridded area so that the cell in row X ...
3
votes
1answer
381 views

Unexpected behaviour of extract function in the raster package

Calculating zonal statistics in R with the extract function in the raster package, I found unexpected behaviour. I have a raster layer of rather large cell size and a polygon layer of relatively small,...
7
votes
2answers
901 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 ...
0
votes
1answer
1k views

How to count raster pixels inside a vector/polygon layer in QGIS?

I have a binary raster (two classes) and I would like to count the pixels of each class contained in a polygon. My goal is to know the amount of pixels of each class of the raster contained in the ...
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 ...
2
votes
1answer
115 views

Inconsistent results using Zonal Statistics by Table for Min in ArcGIS Desktop?

Using ArcGIS Desktop 10.5 I am looking to find the minimum elevation in x number of polygons using a DEM. Using Zonal Statistics method: import arcpy from arcpy import env from arcpy.sa import * env....
0
votes
1answer
219 views

Zonal statistics error in arcpy

I'm trying to get the zonal statistics output (mean), do some operations and add to my main archive the output value. I wrote this code, but it's not running, the error message is: Traceback (most ...
1
vote
0answers
37 views

ZonalStatistics crashing in python randomly?

I am running Arc 10.5 on Windows 10 and am having issues with the Spatial Analyst tool ZonalStatisticsAsTable that appears to crash my python script for no reason. I have used this script before and ...
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'...
1
vote
0answers
72 views

Contingency Table between to Vector (polygon) Layers

I have two polygon layers (Soil Type and Glacial Geology). I want to see the relation of the two as a contingency table. Recall doing this in ArcGIS. I forget the tool but it gave me a list of from/...
1
vote
1answer
309 views

Why is WPS execute process in Geoserver producing this error?

I am trying to compute raster zonal statistics using a TIFF and a Shapefile. I am using WPS process extension for GeoServer. I am trying to use the WPS request builder provided by my GeoServer ...
1
vote
0answers
74 views

How to set a “no data” value to use in Zonal Statistics?

I have a raster with the thickness of an aquifer confining unit and I'm using zonal statistics to calculate the average thickness under a buffer zone around well points. However, in areas where the ...
1
vote
3answers
131 views

Calculate statistics for certain areas of a raster [closed]

I want to calculate the value of certain areas of my raster, which are determined by a polygon layer. I can't use the zonal statistics tool, I receive an error about inputs. How should I do it?(the ...
1
vote
2answers
163 views

How to calculate Standard Deviation in Zonal Analysis Using Python

I am attempting to use the following code to calculate standard deviation: QgsZonalStatistics (QgsVectorLayer *polygonLayer, QgsRasterLayer *rasterLayer, const QString &attributePrefix="", int ...
1
vote
2answers
76 views

Extract the values from a raster based on polygons and add those values directly to the polygon shapefile table in ArcGIS?

I understand that the ZonalStatistics (ArcToolbox -> Spatial Analyst Tools->Zonal->Zonal Statistics) in ArcGIS (10.3) allows the extraction of raster values within zones defined by a polygon shapefile ...
1
vote
0answers
150 views

How to calculate skewness, kurtosis and quartiles with zonal statistics?

I would like to calculate the skewness, kurtosis and quartiles for the elevation of a raster and for a point feature class inside the area of some polygons. I used the zonal statistic tool in ArcGis ...
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 ...
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 ...
2
votes
0answers
250 views

Change coordinates of raster file

I'm trying to compute zonal statistics but get an error saying that "negative dimensions are not allowed". I'm assuming its because my raster file extends into negative coordinates. Extent of the file ...
2
votes
1answer
587 views

QGIS Python script for zonal statistics not running

I got this Python script from this previous post. I've edited it for my project but nothing happens when I execute it. I downloaded the zonal statistics plugin, and usually when I run it, it adds a ...
1
vote
1answer
582 views

Why does Zonal Statistics as Table return an empty table? [closed]

I have a set of polygons with a field of type "SHORT" indicating whether each unit is habitat (1) or not habitat (0). I also have a raster file in GRID format (32-bit, floating point): I would like ...
1
vote
2answers
819 views

Finding min and max raster values using polygons in ArcMap?

I have a raster dataset that encompasses an area which has previously been classified into vegetation types. I have the classification polygons and want to lay them on top of a vegetation index image ...
1
vote
0answers
53 views

Error in Zonal Analysis Stand Alone Script using PyQGIS

I want to do zonal analysis from QGIS standalone script.For this, I am using following code to run through command line Following code is save in .bat file. import sys from qgis.core import * from ...
-1
votes
1answer
216 views

Why zonal statistics as table does not include some of my bigger buffers?

I am using zonal statistics as table for calculating statistical parameters in different size disc and I also use a raster layer(canopy cover) as input. I have reclassified NODATA as 0 value. I have ...
0
votes
0answers
296 views

Selecting contiguous area with raster in ArcMap?

In ArcMap 10.4, I have created a slope raster from a DEM and am trying to select only contiguous areas of slope less than 10 degrees. I have used the raster calculator to select that subset of slopes (...
2
votes
1answer
471 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.
0
votes
0answers
98 views

How to retrieve time-series aggregated data from rasters based on a polygon in PostGIS?

I created a database in PostGIS with some MODIS data stored in the schema.table modis10v04.gpp. A simple query to show the structure of my data is given as follows: SELECT rid, filename, ...
3
votes
1answer
524 views

Compute zonal statistics in QGIS with overlapping features

I would like to compute zonal statistics in QGIS (preferably using the Python console) of a polygon layer with overlapping features. I've seen different questions (and answers) on how to compute ...
1
vote
2answers
601 views

Is there a faster way to add a field based on zonal statistics to an attribute table?

Let's say I have a shapefile 'Mypolygons' with an ID field and a raster 'DEM' giving elevation values. I want to add a field for each row in the 'Mypolygons' attribute table to give the average ...