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
1 vote
0 answers
35 views

QGIS use zonal raster statistics in Field calculator

I want to "sample" a raster by a polygon feature layer, i.e. calculate zonal statistics ('avg', 'min', 'max', ...). I don't want to use the QGIS zonal statistics tool, since it's "...
Honeybear's user avatar
  • 2,334
0 votes
1 answer
24 views

The zonal() function of the Terra package outputting incorrect results

I am attempting to use the zonal() function of the Terra package in R to find out how much population there is for a given municipality. I am using nic_m_0_2020.tif as the source for the population ...
Bushidoenator's user avatar
0 votes
1 answer
37 views

Earth Engine Zonal NDVI Stats Simulation

I am a beginner at GEE and I want to run a simulation where I calculate some zonal stats for NDVI for a bunch of random points within a specified region of interest and plot them on a histogram. This ...
Obleo Demandre's user avatar
0 votes
1 answer
14 views

Create a point that represents the maximum raster value (elevation) within a polygon: Google Earth Engine

I have around 300 polygons spread across a large area and wish to create a set of points, one for each polygon, that represents the maximum elevation value along the edge (or within) the polygon. I ...
Erin's user avatar
  • 147
1 vote
0 answers
56 views

Which QGIS versions has Zonal statistics (in place) tool

I want to append zonal statistics results to input shapefile. I can't use ArcGIS for this. As suggested in this link I downloaded QGIS 3.10.14. Append raster zonal statistics to layer in QGIS But ...
Hemixa Patel's user avatar
0 votes
0 answers
47 views

Error viewing the result of ee.Algorithms.CrossCorrelation

I am facing an issue when using ee.Algorithms.CrossCorrelation in Google Earth Engine. I am using an LST image and an NDVI image as input. The final product seems to have a visualization error since ...
Jhonnattan Oliveira's user avatar
0 votes
0 answers
44 views

Comparing compute chlorophyll-a concentration with Modis Aqua [closed]

I want to see how perform my algorithm that compute chlorophyll-a concentration from Landsat 8 bands. In order to do so I want to compare the computed results with the Modis Aqua dataset. I already ...
Aurélien Lengrand's user avatar
0 votes
0 answers
11 views

Creating table from distance raster

I have made a distance raster in ArcMap using the Euclidean Distance tool from one town to another that appears to be OK (see attached image). I'm trying to determine the distance from each parcel in ...
Dill's user avatar
  • 1
1 vote
2 answers
69 views

How to calculate the average elevation within a certain radius around a grid cell and apply the average to the grid cell in QGIS?

I have two layers in QGIS: a raster layer containing elevation, and a grid cell layer (polygon) containing 1km by 1km squares. I am trying to create a new layer where the elevation of each 1km by 1km ...
p1unge's user avatar
  • 89
1 vote
0 answers
45 views

Getting -inf values when calculating zonal statistics from raster layer in QGIS

I am trying to get some summary statistics from a raster layer (CRS EPSG:3035 - ETRS89-extended / LAEA Europe - Projected) of forest biomass for each polygon in a shapefile layer. I have used the ...
Ana Barros's user avatar
0 votes
1 answer
54 views

rasterstats zonal_statistics returns values that aren't present in passed array

I'm truly stumped on why I'm getting incorrect results with zonal_statistics. I'm passing a geometry and the raster in the normal fashion that's worked for me before, with 'data' as the raster and '...
Samuel T's user avatar
0 votes
0 answers
13 views

Zonal statistics considering the size of the polygons within each raster cel [QGIS]

When I calculate the zonal statistics the mean the size of the polygon is not considered in calculation. The value of the cel in the top left which is covered by a relatively small polygon is weighted ...
N_LLC's user avatar
  • 605
0 votes
0 answers
37 views

Polygon/polygon zonal statistics

I have two polygon layers. One is counties, one is drought severity. I want to compute what fraction of each county is at each of five levels of drought severity. I've looked at "Join Attributes ...
Llaves's user avatar
  • 5,916
0 votes
1 answer
103 views

Memory error: unable to allocate using zonal statistics

I am doing a zonal statistics between a shapefile of cells around the African continent and a raster of population around the world. Both of them are in an equal area projection: World Cylindrical ...
OgeiD's user avatar
  • 522
0 votes
0 answers
46 views

When to use an equal area projection using zonal statistics

I have a shapefile called "Africa" with cells around all the African continent. I also have a raster file of population around the world, called "population". I would like to do a ...
OgeiD's user avatar
  • 522
1 vote
1 answer
39 views

How to calculate average raster index values using window around specified points in ArcGIS Pro

I am using ArcGIS Pro 3.1 and would like to calculate the average index values of a raster within pre-defined areas. I have a raster layer containing index values for each pixel. I also have several X-...
Joseph Teresi's user avatar
1 vote
1 answer
85 views

How can I use the Zonal statistics "append to layer" functionality?

In QGIS (3.28) one can choose Zonal statistics "Append to Layer" as an output option. I'd love to do that, to append zonal statistics columns "in place", however I am lost on how ...
Honeybear's user avatar
  • 2,334
0 votes
1 answer
40 views

Getting the median pixel value for a raster/polygon intersection in PostGIS

I followed the instructions of this article to obtain zonal statistics for the intersection of a raster and polygon. For context, I'm wanting to obtain zonal statistics for every plot within a field ...
ulfgar.longbeard's user avatar
1 vote
1 answer
79 views

PyQGIS 3.22 custom processing script, problem inputting raster and processing zonalstatistics

I'm writing a custom processing script, based on the template, using QGIS 3.22 running on Windows 11. The script runs well as console script, but I want to make it into a custom processing script. ...
Andrew's user avatar
  • 67
0 votes
0 answers
21 views

How to perform zonal stats along a time series?

I'm working in the Google EarthEngine code editor and I try to extract some data from the Sentinel 2 dataset. I want to get the zonal statistic of a field along the time series, aggregating min, max ...
Pierrick Rambaud's user avatar
1 vote
1 answer
68 views

weighted mean of the pixels that touch the shape in rasterstats

I am using rasterstats python package for calculating the zonal statistics of a raster and a vectr geometry like this: stats = zonal_stats('tests/data/polygons.shp', 'tests/data/slope.tif',stats="...
Dinesh Neupane's user avatar
-1 votes
1 answer
40 views

QGIS R Script - Unicode Error

I am working with QGIS 3.32.0-Lima on Windows 11. I am trying to port an R script to QGIS by creating an R script (https://docs.qgis.org/3.28/en/docs/user_manual/appendices/qgis_r_syntax.html). ...
Federico Gianoli's user avatar
0 votes
1 answer
45 views

Splitting a single raster layer into multiple layers based on raster values in QGIS

I am working with a raster layer in QGIS, and within this layer, the raster values are as follows: 10, 11, 12, 13, 21, 22, 23, and 30. I need the number of pixel of each value in city borders. I have ...
Gencergis's user avatar
  • 109
0 votes
2 answers
89 views

QGIS Multiraster Zonal statistics for one vector

Is it possible to make one attribute table using zonal statistics for one vector and multiple rasters layers? I would like to make chart for one field with five sectors (polygons) in that field and ...
Marián Varga's user avatar
2 votes
1 answer
114 views

Get zonal statistics given polygon from 3-bands raster using Rasterstats

I have a 3-bands raster and a set of 30 polygons. I would like to get the median value of all pixels inside each polygon (zonal statistics). For that I'm using rasterstats package for zonal statistics....
ReutKeller's user avatar
  • 2,037
2 votes
1 answer
61 views

Calculating the majority value pixel in a polygon and the percentage of this value within the polygon. QGIS

I have a big shapefile ( more than 500.000 polygons) and a raster file. I want to calculate the majority pixel per polygon, which I can do with zonal statistics. However, I also need the percentage of ...
Tuti_Rodri's user avatar
0 votes
0 answers
26 views

Mean NDVI polygon statistics Google Earth Enginee

I am creating a script to measure the mean NDVI of a series on a given date. I want the NDVI for each part of the polygon layer. I have developed this script that allows me to take images below cloud ...
Alicia's user avatar
  • 1
0 votes
1 answer
66 views

GeoServer's RasterZonalStatistics result interpretation

I am using GeoServer and the RasterZonalStatistics tool with a land use, single-band raster dataset. In the whole raster, each pixel represents a land use category and is given values between 1 and ...
Elen's user avatar
  • 3
0 votes
0 answers
75 views

Zonal statistics produces negative values even after changing min/max values

I am trying to extract the values of raster images (Night light satellite images, VIIRS). I have changed the min to 0 and max to 63 through the min/max settings (User defined). However when running &...
Izzy's user avatar
  • 1
2 votes
0 answers
31 views

Analysing 3 band raster data in QGIS

I've got 80+ raster geotiffs with climatic data (mean temperatures, average precipitation...) and I need to obtain zonal statistics for these layers using administrative boundaries. The information of ...
jpinilla's user avatar
  • 3,180
0 votes
0 answers
29 views

Buffer based on shapefile not lining up with Landsat as precisely as needed in ArcGIS Pro

I am trying to measure beach quality of different coastal districts in Jamaica in ArcGIS Pro. To do this I created a 100m buffer from an administrative shapefile by dissolving the shapefile into one ...
Matt's user avatar
  • 93
2 votes
1 answer
51 views

Zonal statistics based on different categories

I have a vector which contain thousands of buildings of different categories (e.g., residential, office) and a regular sized grid cell vector (but can also convert to raster). I would like to perform ...
lguilhermers's user avatar
0 votes
0 answers
27 views

How to show multiple different atibutes (zonal statistics NDVI and H3 Density grid) in ONE hexagon?

I made H3 Density grid with point vector layer and did zonal statistic for NDVI. Now i would like to make a layer which would show both in one hexagone. So for example one hexagone coloured specific ...
blazka's user avatar
  • 1
0 votes
1 answer
111 views

GeoServer WPS service Raster Zonal Statistics does not give results when using text/csv format to define zone polygon

I am working with GeoServer 2.22 and I'm trying to use the gs:RasterZonalStatistics tool, through the WPS request builder that is provided in the "demos" in GeoServer. The tool runs fine ...
Elen's user avatar
  • 3
0 votes
1 answer
63 views

Calculate statistics from croppped WMS in OpenLayers [closed]

I have a GeoServer WMS layer that I cropped using the ol-ext filter.crop in OpenLayers. This is a layer that has only one band and pixel values between 0 and 100. I want to calculate the statistics of ...
Elen's user avatar
  • 3
1 vote
0 answers
44 views

PyQGIS Zonal Stats

I have several raster layers (37) which I want to extract the maximum value of it's band to the vector associated. I used to run it as batch process and works fine. The problem is that I also have a ...
Sheyla's user avatar
  • 11
1 vote
1 answer
98 views

Calculating raster variance within an area of interest in Python

The zonal statistics tool within QGIS is able to calculate the average raster variance within an area of interest. I am now trying to automate this in Python. I typically use zonal_stats from the ...
user2031's user avatar
  • 221
3 votes
2 answers
245 views

Writing raster statistics in Python as fast as ArcGIS

I am trying to run a Zonal Statistics in Python. My zone raster has about 300,000 different zones, and in each zone I want to calculate several statistics (mean, median, stdev, count, etc.). I've used ...
Jacob Mardian's user avatar
1 vote
0 answers
68 views

QGIS zonal statistics of raster as virtual field for each polygon in vector layer

I have a vector layer containing multiple polygons. Also I have raster layer. Now I would like to add virtual fields (via field calculator) to the attribute table containing the mean/max/min value of ...
gissurfer's user avatar
2 votes
1 answer
48 views

Zonal Statistics not executing in arcpy

I'm trying to run code to automate getting zonal statistics from a folder with almost 50 shapefiles and 6 rasters from another folder. So, each shapefile needs to do the zonal statistics on each ...
brubis's user avatar
  • 139
0 votes
1 answer
68 views

Why QGIS Zonal Statistics gives me wrong results?

I'm learning QGIS and tried zonal statistics, but for some reason it gives me wrong results and I don't know why. This red pixel contains value 1. Then I create a polygon on top of it. And then ...
Temez's user avatar
  • 9
1 vote
1 answer
120 views

Zonal statistics and list extraction using Google Earth Engine Python API

I would like to calculate some zonal statistics for population raster data, over geometries given in a geopandas.GeoDataFrame, and export the results to a Python list. I wrote some code (see below) ...
popoolmica's user avatar
1 vote
0 answers
118 views

Plugin Zonal Statistics not available in 3.30 anymore

I would like to use the Plugin "Zonal Statistics" in 3.30 Version but can`t find it. I also downloaded it manually, but QGIS says "This plugin is incompatible with this version of QGIS&...
user221373's user avatar
4 votes
1 answer
422 views

Rasterstats zonal_stats function on raster returns None values

I am trying to run simple stats on a shapefile using the rasterstats's zonal_stats function. However, when I run the stats, the function only returns "none" for every feature and every ...
emmahaggerty's user avatar
1 vote
1 answer
142 views

Warning using zonal_stats: RuntimeWarning: overflow encountered in reduce return

I have a grid of cells (100km x 100km) around the African continent (shapefile) . I am doing a zonal_stats with the population of each cell. It is a raster data (geotiff) with resolution 1kmx1km. This ...
OgeiD's user avatar
  • 522
1 vote
1 answer
199 views

Google Earth Engine: reduceRegion on multiple bands of daily aggregates

I found this hourly climate-dataset in the GEE catalog, which I want to utilize, to get the daily mean value for six different bands for the time between 2017 and 2022 based on one user-defined AOI (...
Jan Schweighöfer's user avatar
0 votes
0 answers
34 views

ArcGIS Pro: Zonal statistics as table runs sucessfully but generates a blank table

I am trying to find the average distance between locations in a relocated town. I am using the site addresses as the common feature between the tables as those stayed the same. I run the euclidean ...
Lauren  Benedict's user avatar
1 vote
1 answer
70 views

Optimize summary stats PostGIS query for multiple polyline layers over a worldwide grid

I have two global PostGIS polyline layers, one of which is a subset of the other. The subset defines where there are issues with the system being mapped. I am trying to map the likelihood of a ...
jgm_GIS's user avatar
  • 640
0 votes
0 answers
11 views

Adding database info in PyQGIS after running zonal statistics

I'm trying to run zonal statistics in PyQGIS in a loop: for name in geo_lib: if geo_lib[name][0] == 1: rasterLayer = QgsRasterLayer(geo_lib[name][1]) word = name + "...
alessandro_allz's user avatar
0 votes
0 answers
66 views

Excluding NoData zones in zonal statistics as table in ArcGIS Pro

I'm trying to calculate mean values of a raster within buffer zones. In the zonal statistics as table tool window, I unchecked 'Ignore NoData in Calculations' so that there is no mean calculated for ...
Salman's user avatar
  • 716

1
2 3 4 5
11