Questions tagged [rasterstats]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
38 views

Raster statistic

i'm try to use QGIS processing modeler but I've a problem. I need to use the Mean value and the standard deviation in raster calculator algorithm. I've calculated it in raster statistics, how can I do ...
1
vote
0answers
59 views

Faster zonal stats for equal rasters with Python

I'm trying to extract data out of many raster images with different bounding boxes. Using the great rasterstats.zonal_stats it's a good approach, but it takes a considerable amount of time, especially ...
0
votes
0answers
14 views

Automate exporting raster XMLs

I edit my raster catalogs to get a specific symbology and then I have to manually export the XML. I then load the XML into the mosaic dataset. I can't seem to find a way to automate the process of ...
1
vote
1answer
40 views

How do I build a new raster based on raster stats in QGIS?

I want to create a new raster that uses the mean value of the original raster as the base class of the image and then uses a +- 1 and 2 standard deviations as the other four classes of the image. Is ...
3
votes
0answers
115 views

Memory errors when doing Zonal Statistics on a multi polygon shapefile in Python

I want to calculate the mean NDVI with the EthNdvi.tif file for each zone (there are around 650 admin zones) in the the woreda shapefile. I'm having some issues with running the following lines of ...
1
vote
0answers
235 views

How to open memory data with ogr in rasterstats function?

I would like to reuse vector data created in memory in another function called rasterstats (source code, documentation): I have a function that creates vector data: def createPolygons: ...
2
votes
0answers
55 views

On-the-fly zonal statistics in QGIS

I would like to know if there is a plugin/method in QGIS to calculate zonal statistics (mean, median, range, max, min etc.) of a raster file, corresponding to a polygon that I draw/highlight in QGIS. ...
0
votes
1answer
34 views

Using modeled surfaces together to make predictions?

My question is about stacking multiple rasters of predicted surfaces, that have some of the same predictors. For example, if I make a predicted surface using all the terrain attributes as ...
5
votes
0answers
392 views

Calculating average pixel value for each band across multiple raster layers?

I have a set of raster files that are essentially data sets of precipitation across a region. I have multiple raster files that are the outputs of different climate models. Each pixel in the raster ...
0
votes
1answer
194 views

Calculating Zonal Stacks on imagery with missing pixels

I'm trying to calculate zonal statistics on some imagery that has a bunch of pixels that come out as 0s. This is affecting the mean value for the area, or at least seems to be. I'm using the ...
3
votes
1answer
125 views

No data pixels in raster file

I have a TIFF file and I'm trying to use rasterstats to get statistics of different geometries defined in a shapefile or a TopoJSON file. But I'm getting the count as 0 for all the geometries. My ...
4
votes
2answers
3k views

How to calculate raster statistics for each values in a band?

I have one raster scene that contains one band with multiple pixel values (0-14). Each values represent deforestation in certain year (0=no tree cover loss, 1=loss in 2001, 2=loss in 2002, and so on) ...
1
vote
0answers
179 views

Qgis not computing raster stats in layer properties - metadata?

I used to check the sum of all values of a raster (to get some volume information) from the layer properties - Metadata - properties tab, where I had directly the figure I was looking for. However, ...
7
votes
2answers
448 views

Is there an open-source equivalent of ArcGIS “Zonal Statistics as Table” tool?

With ArcGIS zonal statistics as a table I can easily calculate the mean value from a raster contained within a polygon from a shapefile. I now have a Mac, and therefore I cannot access ArcGIS anymore. ...
1
vote
0answers
897 views

How to resolve “'NoneType' object is not callable” TypeError when calling rasterstats.zonal_stats from ArcPy script?

I'm attempting to workaround the apparent zonal statistics bug in ArcGIS 10.4 by using rasterstats.zonal_stats. stats = zonal_stats(shapefile_full_path, rast_full_path,0,1,None,None,{'mean','min','...
1
vote
1answer
526 views

Writing geoJson from rasterstats

How would I write a proper geoJson, readable by a GIS, from the results of the rasterstats package? stats = zonal_stats("somePolygons.shp", "someTif.tif", ...
2
votes
1answer
417 views

Using zonal_stats with python in QGIS to calculate statistics for each image

I work with Python in QGIS, I want to calculate statistics for each image that I have with a specify shapefile and save result after, I tried to do like this: from rasterstats import zonal_stats ...
5
votes
1answer
873 views

Geopandas and Zonal Statistic error

I'm trying to use Geopandas and zonal statistic from rasterstats together. I run this code import geopandas as gpd from rasterstats import zonal_stats geodf = gpd.read_file("SHP/shape.shp") ...
3
votes
1answer
493 views

How to compute zonal statistics fast?

I have 12000 circles with a radius of 50 miles on a raster with 0.05 degree resolution. Global analysis. The raster is 32 bit float and I have to calculate zonal statistics for 20 different rasters. ...
7
votes
1answer
741 views

Weighted zonal statistics in Python and/or R [closed]

I have raster files with precipitation data (4x4 km), monthly, for about 100 years. I have a shapefile for a watershed (which includes several polygons as sub-basins). I need the average precipitation ...