Calculating Zonal Statistics of a Raster using Python

preview_player
Показать описание
This tutorial explains the basics of calculating the zonal statistics such as average, max, min values corresponding to a defined spatial area of a raster using a polygon vector layer using Python, with the aid of GeoPandas, rasterio and rasterstats libraries. Additionally, you will learn how to plot rasters and vectors on the same layer, how to use matplotlib subplots to plot maps and histograms together in the same canvas, as well as to extract the summary of the data into a Pandas DataFrame using the Pandas library.

⭐NOTE:
‘Kite’ is an excellent tool that can help you boost your productivity when it comes to programming with its free Artificial Intelligence (AI) powered coding assistant. Kite is a plugin which provides smart completions and documentation as you’re typing-in your code, and its compatible with most of the well-known IDEs such as PyCharm, Spyder and VS Code. I absolutely love it, and recommend you guys to try it out as well.
Рекомендации по теме
Комментарии
Автор

Just wanted to thank you for these vids, wish I had them during my time at Uni but now as a GIS professional I’m feeling even more inspired by your work! Looking forward to the next one : )

olssonfilip
Автор

Very Good job GeoDelta Labs. I don't have enough words to thank you. Please please kindly post the part 2 tutorial Calculating Zonal Statistics of a Raster using Python. Looking forward to that:

moisengwa
Автор

Dear Sir, Thank you much . You are sooo nice and kind . You are sooo expert in GIS . I hope you will continue your help .Its really very very helpful for me . I actually want to do that one . Sir, you solved my problem . Once again THANK YOU soo much .

muhammadanjum
Автор

I am too late to learn from this interesting and very useful tutorial. Thank you so much!

mulugetaworkuayele
Автор

Thank you. This was very helpful for me in my thesis🙏

amitblizer
Автор

Thank you very much for sharing this with us! much appreciated.

abramswee
Автор

good job bro...more geopandas pls.. one thing you have a good voice

shaileshshrestha
Автор

I didn't need to go to Uni because of these videos, thx

jeffz
Автор

Dear @GeoDelta Labs,
Thanks for this great tutorial. Very much appreciable. Waiting for part two with multiple raster data.
I have a couple questions. Do I have to project both my vector and raster dataset? If so how could I project multiple raster datasets at once? and the second question is while plotting/showing the raster data how could I show also raster scale right-side on my raster plot? Thanks in advance.

gmjakirullahnooruddin
Автор

The tutorial was very good, I learned a lot! A question, where did you download this data? I wanted to download to Brazil.

hugonicolaubarbosadegusmao
Автор

Hello, Thanks for this great tutorial. I have a question, while calculating the average, are taking in account the nodata pixels?
If yes, is there a way to exclude nodata pixels while calculating average?

Thanks in advance for your answer.

manuvideos
Автор

Hi @Geo Data Labs,
Great Tutorial thanks for this
And please can you make tutorials on the liabrary raterio

aakashbhatt
Автор

@GeoDelta Labs, thank you very much for this fantastic tutorial. Just one question: how can I save the "mean" dataset in the shapefile?
After I have performed the zonal statistic, I have open the shapefile with QGis but the "mean" column was not present in the attribute table. Thanks

australoitaliano
Автор

Very great and clear work you have done. i have a question please, i am working on my raster dataset for prediction like ANN, RF and CNN, i have converted the rasters into numeric and then train and test the data and got very good accuracy. Now i need to convert my test data into raster again as final prediction map but i don't know how to do this, please guide me thanks.

umairrasool
Автор

Please make the video for mapping of CSV data in geotiff. CSV have lat lon and values

DileepGuptagoodman
Автор

Thanks a lot for this! ...just one question, if I want to extract the 95th percentile at any of the districts, wherever the raster is present. What modification in the code do I need to do. Anyone's help is really appreciated

kaustavdas
Автор

Can you please make more videos
How to extract and compute volumes from raster
How to make hydrogeological analysis
And so on

yaarobmohammad
Автор

Hi GeoDelta thanks for the video. I have a question. Did you check the values where your raster has no data or zero values? I am getting negative values and I do not know how to correct them.
Thanks!

raquelzafrir
Автор

How to install rasterio and rasterstats?? Can you provide your video link below

reshmaa
Автор

Hello Sir, can you please tell me how to perform zonal statistics on each band of raster stack.
Thank you very much for making such useful videos.

sonalisharma