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
1 answer
38 views

Performing a zonal statistics looping over rasters and over polygons

I have a shapefile with overlapping polygons and a set of rasters. I would like to summarize some statistics on my polygons. However, as my polygons are overlapping, to avoid issues with zonal_stats, ...
OgeiD's user avatar
  • 536
2 votes
1 answer
77 views

Iterating over the features of a vector layor then performing zonal statistics algorithm on each feature in PyQGIS

I composed this script in PyQGIS to perform the zonal statistics on a vector layer as for all its features at once, it works perfectly, when the script is finished, I inspected the attribute table and ...
Khaled's user avatar
  • 277
0 votes
0 answers
25 views

How to get zonal statistics of a vector map by areas from another vector map in GRASS GIS?

I have a map with areas (polygons) and another map with lines for example. Lines have multiple attributes and I want some of them to be summed and written to new columns of my areas map. Each polygon ...
Nikolay Yasinskiy's user avatar
0 votes
1 answer
27 views

Earth Engine Zonal Stats export table error message

I am trying to calculate zonal statistics of vegetation indices (Sentinel 2) for each week in 2023 and export the results in a wide table format (.csv). For the specific region, I am using points data....
Gaelle Tatiana Alexandrine Seh's user avatar
1 vote
0 answers
22 views

Zonal statistics over Trend Raster [closed]

I have a raster containing Mann-Kendall trend values and p-values for each pixel. Essentially, I possess both the magnitude of the trend and the corresponding significance level per pixel. I aim to ...
Biogirls's user avatar
0 votes
0 answers
11 views

Selecting a subset of features from feature collection in reduceRegions()

In an attempt to find ndvi and gndvi over a geometry containing 160 polygons, I have the following code. var s2 = ee.ImageCollection('COPERNICUS/S2_HARMONIZED'); var geometry = ee.FeatureCollection('...
rekha's user avatar
  • 1
0 votes
0 answers
47 views

Zonal Statistics in QGIS

I am using raster layer zonal statistics in QGIS. I want to quantify the water yield contribution of each LULC class, but the results of the zonal statistics is greater than the value given by the ...
ccquinon's user avatar
1 vote
0 answers
23 views

Zonal statistics

I am using Python on Visual Code Studio. Basically, I have two raster images, GHS SMOD (which classifies areas into 8 catergories of urban) and GHS POP (which uses world pop to calculate population). ...
Marziya Farooq's user avatar
0 votes
1 answer
24 views

Issue with reprojected raster data

I have a raster dataset that is projected with the "NAD_1983_Albers" projected coordinate system and a shapefile projected with "WGS 1984 Web Mercator (auxiliary sphere)." I am ...
Ben M's user avatar
  • 1
0 votes
1 answer
40 views

How to summarize vegetation data of a raster layer within a series of clipped polygons

I'm trying to analyze how much of the land cover percentage within a series of polygons along a river is Tree Cover. I made a 5000m buffer around the Columbia River in Washington state, then overlayed ...
Just here for my final project's user avatar
1 vote
0 answers
51 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,386
0 votes
1 answer
94 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
44 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
19 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
  • 157
1 vote
0 answers
62 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
70 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
13 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
122 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
  • 109
1 vote
0 answers
54 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
78 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
14 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
  • 615
0 votes
0 answers
38 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,951
0 votes
1 answer
147 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
  • 536
0 votes
0 answers
54 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
  • 536
1 vote
1 answer
81 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
133 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,386
0 votes
1 answer
63 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
95 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
26 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
133 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
50 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
85 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
131 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
187 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,107
2 votes
1 answer
93 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
27 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
85 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
95 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
  • 11
2 votes
0 answers
38 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,230
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
68 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
31 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
134 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
73 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
48 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
138 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
340 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
86 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
92 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
2 3 4 5
12