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

Failing at using 'Zonal Statistics As Table' to calculate the number of pixels per class, for each individual area (19 total) of a classified raster

I am using ArcGIS Pro 10.2.9. I have a raster. I used a polygon feature class (19 rows of data) to clip the raster into 19 distinct areas, some of which abut each other. I classified the clipped ...
  • 11
1 vote
0 answers
24 views

Overlaying rasters with different dimensions

I am new in QGIS. I have several (108) rasters (each one representing the global distribution of a specific species), I want to combine with a vector file representing different regions of the world, ...
0 votes
0 answers
11 views

Calculate area of raster overlap with polygon by raster value, geopandas

I have two inputs, a raster with values ranging between 0-2, and a polygon shapefile. import geopandas as gpd import xarray as xr import rasterio import rioxarray from rasterstats import zonal_stats ...
  • 323
1 vote
0 answers
24 views

Raster Statistics of Fire Driven Forest Loss within shapefile

I have two inputs, a shapefile which I am reading in as a geodataframe, and raster data from - GFW Fire Driven Forest Loss dataset (see: https://glad.umd.edu/dataset/Fire_GFL/ ) From documentation: &...
  • 323
0 votes
0 answers
15 views

Zonal stat of imd rainfall .nc file for polygons within shapefile using PyQGIS

How to extract imd rainfall data for polygons(district level) within a shapefile?. Used PyQGIS , solution (given below) wherein output for each day of all polygons is exported as .csv file. Had to ...
1 vote
2 answers
33 views

Computing zonal statistics with Rasterstats in Python

I have a satellite imagery .tif file, and a corresponding .shp file with polygons over buildings. For each band (3 bands total) in the image, I'd like to calculate zonal statistics within each polygon....
  • 13
0 votes
1 answer
63 views

Extract specific pixel's values in all bands of multiband image [closed]

Earlier related post here: (Extract Median Value of composite but keep associated pixel data) Reposting for additional clarity and refined question. Datasets: Multiband Image with bands ['NDVI', 'Red',...
0 votes
1 answer
44 views

How to get all unique raster values of intersecting vector in Python?

I have a tif-file containing categorical numerical land cover values and a gdf-file containing roads as linestrings. I'd like to create a new column to the road gdf that contains all unique ...
  • 35
0 votes
0 answers
21 views

ArcGIS Pro calculations combining joined and zonal statistics tables

I have calculated the area of intersect/sum of intersect of rasters using zonal statistics by using province ID as a zone field. I now want to divide that summed data for each province, by the total ...
  • 1
2 votes
1 answer
32 views

Creating overlays and calculating area of intersect

I'm currently mapping for deforestation and species risk from palm oil plantations. I'm trying to calculate the area of intersect between the individual species and p-oil plantations and deforestation ...
  • 21
0 votes
1 answer
31 views

GEE add a constant median band representing the median of pixels within a multipolygon

I have a time series of Sentinel-2 images and I'd like to get a single median EVI index value over a multipolygon representing known land-cover areas in each image and set that as a constant band ...
2 votes
1 answer
61 views

QGIS Zonal Statistics by cursor selection

I am able to summarise data about particular area of a raster by generating a temporary polygon and using the Zonal Statistics tool as normal. Is there a tool or a way to generate summary data about ...
  • 403
0 votes
1 answer
108 views

Zonal Statistics Spatial Join Raster to Polygon in Python

I have a data frame that consists of 3 polygons I have a raster with a single band Seems like Zonal statistics as a table in ArcGIS does the job but I am using pure python script on this one; with no ...
  • 774
0 votes
1 answer
128 views

Calculate average value of raster within polygons based on type

I have seen How to calculate the average value of a raster within polygons?, which helps me a bit but not completely. I have a raster of 16000 by 12000 (country-size) and a vector which indicates ...
  • 95
0 votes
2 answers
63 views

How to find dominant pixel count of one raster in another raster with different cell size?

I have one raster that is categorical values for land cover classes (from the NLCD) at 30m resolution. I also have another raster for land surface temperature (LST) data at 70m resolution. I would ...
2 votes
1 answer
70 views

Zonal Statistics as table on population raster does not produce correct regional population figures using ArcGIS Pro

I have a population raster (from Worldpop.org) with data on the population count of Philippines. It is unconstrained data from 2020, 100m resolution. Link to raster: https://www.worldpop.org/geodata/...
0 votes
0 answers
201 views

Draw polygon interactively in Python Dash and get zonal histogram/statistics

The problem I would like to be able to interactively draw a polygon on a choropleth map, where I can draw as many vertices as needed. After drawing the polygon, I would like to get back the zonal ...
  • 45
2 votes
0 answers
141 views

Getting Sentinel-2 raster values for points on Google Earth Engine

I am calculating TSM and chlorophylle in a river, for each parameter I used a function to create a new band that gives me information about each one. First I want to calculate the mean value for ...
3 votes
0 answers
70 views

Weighted zonal statistics in Python

I'm asking something similar than Weighted zonal statistics in Python and/or R. I know very well the R-side of this question, but I can't figure out the answer for Python. So far I can compute non-...
  • 12.3k
1 vote
1 answer
45 views

Resampling high resolution data into lower resolution based on most common value

I want to use a high-resolution classification (3cm) as training data for a classification using Sentinel 2 data (10m). To do so, I want find which high-res value is most common within each Sentinel &...
1 vote
0 answers
48 views

Zonal Statistics and output cell size

I am trying to use Zonal Statistics to find the most common value of a high-resolution classification within a coarser fishnet grid (10x10 m). The idea is to use this high-res classification as ...
0 votes
0 answers
49 views

PostGIS SummaryStats with many polygons and many bands

I have a hyperspectral image (160 bands) and a polygon shapefile with several thousand polygons. I need to extract mean value of each band within each polygon and store it in a table. I decided to try ...
  • 187
0 votes
0 answers
87 views

Unexpected values for 'SUM' and 'COUNT' in Zonal Statistics

I am using the zonal_stats function in the rasterstats package to evaluate the pixels within each polygon in a shapefile. The raster used is a binary mask layer (object exg) in which pixels ...
  • 71
1 vote
1 answer
52 views

QGIS Zonal Statistics

I have used and FAO raster file for e.g., suitability for agriculture and I calculate zonal statistics at the NUTS 2 level. However, given the fact that the cell size of each cell is not the same ...
0 votes
1 answer
97 views

Zonal Statistics not Working Properly in ArcGIS Desktop

I have two rasters, one that describes different zones of the world and a second one which is the input raster that has continuous values for a variable. I am using the Zonal Statistics tool to ...
1 vote
0 answers
51 views

How to calculate sum of night light radiance for each feature in a feature collection?

I have a shapefile which contains 36 polygons (districts/counties). For each district, I want to calculate sum of lights (as well as count total number of pixels). I tried following code but failed. ...
1 vote
0 answers
98 views

QGIS - calculate volume from DSM

I've been following a tutorial (https://www.pointsnorthgis.ca/blog/how-to-calculate-surfacecut-volume-qgis-advanced/) in order to try to find volumes for various stockpiles that I took imagery of with ...
  • 822
1 vote
2 answers
489 views

How to use zonal statistics in R with shapefile

I have a county shapefile and a DEM raster, I want to extract mean DEM of every counties. There is a function 'zonal' in raster package, however, it requires raster not shapefile. How can I do this ...
  • 103
2 votes
1 answer
441 views

Error with function argument when using extract function in R

I am using the script described here to try to extract a count of raster cells within polygons in a shapefile. This code worked for me yesterday but today I am getting the following error: Error in ...
  • 61
0 votes
1 answer
25 views

Count area of specific raster value inside polygons

I am currently working with annual forest loss raster data from Global forest watch. (https://data.globalforestwatch.org/documents/14228e6347c44f5691572169e9e107ad/explore) Data is built up so that ...
0 votes
1 answer
110 views

Cumulative sum of thermal anomalies in Earth Engine

I am writing a short script that will be used to chart thermal anomalies (FIRMS) by year for a given boundary. The following code will achieve this... var now = new Date() // IMPORT MODIS ACTIVE ...
0 votes
0 answers
32 views

Zonal Statistics - the algorithm computes the average statistics for all the polygons of the layer vector

Using QGIS, I want to compute the average elevation per 1890 US counties. I have a shapefile with the 1890 counties boundaries with fixed geometry, and STRM elevation data, saved as a GeoTIFF file. ...
1 vote
1 answer
168 views

Find mean zonal stats using a geoseries or GeoJSON object - Python

I have a TIFF file with imperviousness levels and a Geoseries object containing the boundary coordinates of circles around 9 points. I want to find the mean value using zonal_stats but I don't know ...
0 votes
0 answers
32 views

Rasterize monthly mesh data

I am working with QGIS and I would like to rasterize mesh data (ERA5 monthly averaged data on temperature) from 1998 to 2018 in order to perform zonal statistics. However, given the huge number of ...
0 votes
0 answers
28 views

Summarizing global soil erosion raster data

Using ESDAC's Global Soil Erosion data which is 25km resolution with values representing metric tons lost per hectare per year. I'm trying to summarize by certain regions using ArcGIS Pro Zonal ...
  • 1,141
2 votes
1 answer
407 views

Unable to perform zonal stats in python because of Attribute Error

I am trying to carry out a simple zonal statistics task in python, and am having trouble getting this to work. I have a raster layer (in black/grayscale) and a roads polygons layer (in green, actually ...
0 votes
0 answers
152 views

Unable to perform zonal statistics in Python because of affine error

I have a raster layer and a polygons layer I want to use for zonal statistics, however these two files may be in a completely different projection and CRS. I am trying to use the following python code ...
2 votes
1 answer
135 views

Changing inline variable %name% in ModelBuilder of ArcMap

I have a lot of MODIS tif files in a folder and I want to calculate zonal statistics of each tiff file according to polygon in my shapefile. I am trying this in ModelBuilder of ArcMap 10.3.1 However, ...
0 votes
0 answers
94 views

Zonal Statistics results are Null in QGIS

I am relatively new to QGIS and I am having issues with Zonal Statistics. I keep receiving NULL as my results for the median. I am trying to create a map displaying the median temperature for each ...
  • 9
2 votes
3 answers
290 views

Zonal statistics with GDAL only (not Python)

I'm helping an undergrad with her dissertation. She has monthly mean data from ERA-5 for three variables in netcdf format for the past 20 years. She wants a CSV or Excel file which contains the zonal ...
  • 51
0 votes
0 answers
123 views

Reducing image resolution to sum using Google Earth Engine JavaScript API

How do I accurately reduce the resolution of an image with a global extent by summing values in GEE and then export to drive? I am trying to export this global forest carbon potential dataset (...
  • 765
0 votes
1 answer
47 views

Include two iterators in ModelBuilder to use zonal statistics as table

I am facing a problem because I know is not possible to include 2 iterators in the same ModelBuilder model. I have 10 features (polygons) in a shapefile and 1000 rasters in a folder. I want to ...
  • 209
3 votes
1 answer
186 views

Calculating number of pixels of dominant class in QGIS

I have a land use classification raster file and a grided (5 km² grids) shapefile of my study region. I want to compute a landscape complexity index (LC) which can be computed by: LC = number of ...
0 votes
1 answer
62 views

Landcover image coverage of each class in study area

I want to define a dictionary with landcover type and their coverage in my study area. I wrote the code as below, but it is not working as I want. How can I define a dictionary or another datatype to ...
  • 97
1 vote
1 answer
159 views

Looping grouped reductions using ImageCollections and FeatureCollections in Google Earth Engine

Using an example from Google Developers (Grouped Reductions and Zonal Statistics), I was able to write a script that calculates burned area within land cover classes of a national forest... link to ...
0 votes
1 answer
39 views

Reading values from file Geodatabase table and assigning those values to variable [closed]

I created a table using the zonal statistics as a table tool which contains some percentile values of a raster (90%, 75%, etc). The table is 1 row and contains the percentile values. I want to take ...
  • 121
0 votes
1 answer
68 views

Error in combining feature id, date and mean NDVI value parameters for export in GEE

What I need is to add Point, Object and Date Ids to the before NDVI Mean value. Such that when I export my feature collection it has the point id(Objectid), date id, and mean NDVI parameters. These ...
  • 162
3 votes
1 answer
2k views

"ValueError: negative dimensions are not allowed" when using raster created from NetCDF

My code creates a geoTiff from a NetCDF and then I'm trying to compute zonal_stats() from a raster file I created from a NetCDF. I end up getting ValueError: negative dimensions are not allowed at the ...
  • 289
0 votes
0 answers
67 views

Want to calculate percent cover of land use categories within buffer areas?

I have point data and a land use map. I created 100m buffers around each point, I now want to calculate the percentage of cover represented by each land use category detected within the buffers. Would ...
1 vote
1 answer
235 views

Getting output from reducer (frequency histogram) for every polygons in feature collection using Google Earth Engine

Context: I'm trying to calculate forest cover for each districts in a province. I used the reducer function (frequency histogram) on a raster, using a feature collection object as its "cookie ...

1
2 3 4 5
10