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
1answer
47 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 ...
0
votes
0answers
19 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 (...
0
votes
0answers
24 views

Iterate through rasters and use the calculate field tool to populate a field in those rasters using ModelBuilder [closed]

I have quite a few rasters of drought index data, classified into drought (0) and not drought (1). Each raster has a cell count for each value, and by dividing by the total I can get percent of ...
0
votes
1answer
28 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 ...
3
votes
1answer
50 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
1answer
35 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 ...
1
vote
1answer
42 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
1answer
25 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 ...
0
votes
1answer
54 views

Calculating zonal statistics with rasterstats

I am trying to calculate zonal statistics with rasterstats. The shapefile containes about 2000 polygons for which I need to calculate the underlying basic statistics (mean, median etc.). When I use ...
0
votes
1answer
45 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 ...
2
votes
1answer
116 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 ...
0
votes
0answers
26 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
1answer
35 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 ...
0
votes
1answer
31 views

How Rasterstats function works

I would like to know how the zonal_stats() function from the library rasterstats works, as I am calculating the mean values of a raster within a polygon. If a raster cell touches partially the polygon ...
0
votes
0answers
47 views

QGIS Zonal statistics and Python Rasterstats yield different results

I have one polygon shapefile and one raster file (both EPSG: 4326) and I am calculating the minimum, maximum and average raster value in all polygons using two methods: QGIS 3.16.10, Zonal statistics ...
-1
votes
1answer
47 views

ZonalStatisticsAsTable misses 245 polygons out of 3108! using ArcPy with ArcGIS Pro

I have many .ncf files that I read as raster layers and then do zonal statistics to have mean and sd values over each of 3108 CONUS counties. But the final standalone table is missing 245 counties. ...
0
votes
0answers
25 views

Optimize zonal statistics to calculate overlapping polygons (1 input FC, 2 rasters)

For my analysis I am using zonal statistics (arcpy) to calculate the elevation and slope statistics of about 12k overlapping administrative boundaries. The boundaries are located in one Feature Class, ...
2
votes
1answer
131 views

Zonal Histogram - Python

My main goal is to get the percentage of vegetation cover of gardens. The figure below shows the gardens (orange borders) with vegetation and non-vegetation. I want for each garden the percentage of ...
0
votes
1answer
111 views

Daily Rainfall data extraction from CHIRPS database for polygons using Google Earth Engine

I don't use GEE a lot but I have to use it to extract daily rainfall data from the CHIRPS database. It should be simple but I am stuck. The outcome should be one CSV file with three columns: polygon ...
1
vote
0answers
46 views

NetCDF in QGIS --constructing time series using 1368 bands

I have the NetCDF file that contains monthly gridded temperature from 1900 to 2014 (air.mon.mean.v501.nc). The goal is to extract monthly time series for every polygon in my shapefile. Using the US ...
1
vote
1answer
53 views

"AttributeError: 'QgsZonalStatistics' object has no attribute 'getFeatures'" when filtering ZonalStatistics result in PyQGIS

I want to calculate zonal stats of a raster using a polygon layer and the filter the ouput as another layer. This is the code I tried: zoneStat = QgsZonalStatistics (tempVectorLyr, rasterLyr, '-', 1) ...
0
votes
0answers
19 views

Continuously receiving NoData as Raster tool output

I'm running ArcGIS Desktop version 10.7. I'm working with a DEM and DSM, both from the same municipal data source (not prepared by me). I am attempting to do some simple analysis on both of these such ...
0
votes
0answers
47 views

Extracting pixel values from dispersed pixels across various countries

I am trying to calculate extreme events of rainfall using ERA-5 Daily Data in Google Earth Engine through Python. I am trying to find pixels that had more rain than the 95th percentile of the previous ...
3
votes
1answer
120 views

Exporting zonal statistics attribute table from QGIS

I have two layers: one is solar radiation, one is town boundaries. I used zonal statistics and seem to have correctly generated that. I'm able to view the attribute table and all seems to be in order. ...
2
votes
1answer
140 views

Extracting mean raster value from buffer around point w/ Google Earth Engine

New GEE user here. I am trying to calculate the mean value of the global human modification (GHM) layer in buffers around points with Google Earth Engine. I'm following this tutorial very closely - ...
1
vote
1answer
114 views

Zonal statistics in R: using exactextractr to extract the counts of a range of pixel values from a raster

I have a raster with pixel values from 0 to 20, and I'm trying to count each pixel value with R package exactextractr. I have the raster ('def'), a SpatialPolygons object ('grid10') and an empty ...
2
votes
1answer
176 views

Counting percentage of raster cell inside polygon using QGIS

I have a raster image that contains a different value and the polygons over the raster's (attached below). Is it possible to calculate the percentage of different cells inside the polygon i.e., 20% ...
1
vote
1answer
87 views

Counting of raster cells under polygon using QGIS

I have raster image overlap with shapefile (attached below). Is it possible to count the number of cells with specific value. for i.e., I have a 500 raster cells. 200 raster cells give 1st value and ...
2
votes
1answer
65 views

Return whole array from zonal stats

There are some good examples of how to calculate zonal stats using geopandas and Rasterio/GDAL but all of these return a single statistic. Is there a method to return all of the pixel values so that ...
1
vote
1answer
36 views

QGIS Zonal Statistics returns empty

I am using QGIS 3.18 to do a quick calculation of the population inside a buffered area. The data for the population comes from WorldPop, the file I got is in the form of GeoTIFF. I inserted it as a ...
1
vote
0answers
63 views

How to get zonal stats only for fully covered pixels in Python

I want to get the statics of raster values per polygon in a shape file in Python. Currently I use: https://pythonhosted.org/rasterstats/. But as I understand it has two raster stategies: all_touched=...
0
votes
1answer
37 views

Analysing Raster, Shapefile and DBF together using ArcGIS Pro

Note at the bottom for a possible solution, though it's not very elegant! I’m at a bit of a brick wall – I think this probably has a really simple solution, but I’m not quite sure where to start. ...
0
votes
0answers
10 views

Troubles replacing null values with specific numbers [duplicate]

After i've used "zonal statistics as table" on some buffers, some values got lost (which seems to be a common problem when buffers overlap as mine does). Now, i would like to replace these ...
1
vote
1answer
59 views

Calculating zonal statistics as table for all attributes (columns) in raster using ArcGIS Desktop

I have a raster that has multiple columns in the attribute table that I can symbolize. I would like to calculate zonal statistics as a table for each of the columns in the raster attribute table ...
0
votes
1answer
22 views

How to select classes from a GeoTIFF world map and compute the area by regions defined in a shapefile

I have two files: fileLUse.tif defines land cover classes in GeoTiff format (from https://www.esa-landcover-cci.org/?q=node/164) fileRegions.shp defines administrative borders and it is a shapefile (...
1
vote
1answer
110 views

QGIS zonalstatisticsfb returns NULL

I am trying to calculate the population count (raster geotiff) lying under a polygon (vector layer). The appropriate QGIS library zonalstatisticsfb sum returns NULL. My QGIS python code is: processing....
0
votes
1answer
26 views

Extracting data to table for two rasters with identical polygons (different values) using ArcGIS Pro

I have a raster image of watershed catchments where the raster value is the catchment ID. Using this raster and the "Zonal Statistics", I created a separate raster of land use where the ...
0
votes
0answers
133 views

Zonal Statistics in QGIS 3.16

I have a NDVI raster file generate from Landsat-8 data and using the Identify Features tool I am able to observe the individual values per pixel. I also have a vector kml file breaking down a region ...
1
vote
1answer
78 views

Mapping over a reduceRegions command in Earth Engine

I have a feature collection of about 80,000 tiles, and I am trying to calculate the annual maximum drought severity index score for each tile using TerraClimate data. TerraClimate is an image ...
3
votes
1answer
330 views

rasterstats zonal statistics does not ignore nodata

I am trying to write a script to perform some zonal statistics with rasterestats, but I am really struggling with nodata values. I noticed a different behaviour 1) when running zonal_stats with numpy ...
0
votes
1answer
38 views

Average polygon value

I have a bitmap that contains a polygon NDVI and nodata space. How do I get the average value of the polygon only, and not the entire raster.
0
votes
0answers
32 views

Counting number of pixels in each tile in Earth Engine

I have 0.02° tiles across some regions of interest in Africa. I am trying to find the percent of 300m ESA land cover pixels that are classified as cropland (classification 10-30) for each tile, as ...
0
votes
0answers
24 views

Transforming or reprojecting Vector to another CRS without using ballpark transformations that result in loss of geometry

I am having trouble converting CRS of a Vector and getting the error: Used a ballpark transform from EPSG:4326 to EPSG:2230 The Details are below. An alternative, ballpark-only transform was used when ...
0
votes
0answers
30 views

Statistical difference in DEM-height compared to a specific point(feature)

Recently I've been struggling when trying to compare surrounding points of a DEM to a specific one (a feature in my case. A castle to be precise). I want to find out how steep a slope in an area ...
3
votes
0answers
45 views

QGIS Zonal Statistics: Sum of Partial Area Larger Than Sum of Total Area

I've been trying to use zonal statistics to get the proportion of a population in an area relative to the larger administrative district that the area falls under. My workflow is: Run zonal ...
1
vote
1answer
47 views

Reduce region applied to multi-country area when ImageCollection is organized by country and year in Google Earth Engine

I am calculating zonal statistics for 0.01-degree tiles that fall within buffer areas across sub-Saharan Africa. I want to determine the estimated population counts within the tiles for years 2001-...
0
votes
1answer
105 views

Polygon Drill on Open Data Cube

I face a crucial problem with ODC. I try to do a spatial join with a shapefile (polygon drill). I have followed the following steps: Read the shapefile and get the first polygon to test Ensure that ...
1
vote
1answer
86 views

Calculating zonal entropy index for raster using rasterstats

I have an elevation raster and a grid shapefile: What I want to do is calculate zonal statistics of the raster based on the grid features. The "statistic" I want is the entropy index (...
2
votes
2answers
108 views

Changing Legend Symbology to include a 'Sum' field using QGIS 3.16.3 Python Console

I currently have a vector layer that contains intensity polygons and are colour co-ordinated depending on the level of intensity. Within this 'Intensity' file, there are two columns Intensity and ...
0
votes
1answer
472 views

Zonal statistics with feature collection column (Google Earth Engine)

I have run into a very similar problem a few times while working in Google Earth Engine and never found a good solution. I am working with raster data (continuous values) and a feature collection of ...

1
2 3 4 5
10