From the course: Geospatial Raster Data Analytics in Python
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Applying simple functions on raster data: Part 2 - Python Tutorial
From the course: Geospatial Raster Data Analytics in Python
Applying simple functions on raster data: Part 2
- In the next analytical exercise, we will learn how to derive new roster layers based on two initial layers by using two simple mathematical operations, taking the sum and the product of the two layers. In both cases, we are doing these operations element wise. Here we will use the normalized band data from the previous part of this course. However, we could just as easily use the original roster as well. Additionally, at the end of the code block, we will export the resulting rosters as single band D files. Now first, let's create the sum and the product of the two grids. Since both of the bands are stored in MPI arrays, arithmetic operations are relatively simple with them. Now let's have a look at what we created. Again, the roster is full of zeros, so just by printing it, we don't learn much about the data. So let's compute a few simpler statistical measures of it. First, to set the baseline for our expectations, let's print the extreme values of the two bands, which should be…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Prepare real-world raster data3m 35s
-
(Locked)
Elevation raster data4m 48s
-
(Locked)
Reprojecting raster data8m 57s
-
(Locked)
Resampling raster data6m 20s
-
(Locked)
Create multiband raster data4m 16s
-
(Locked)
Applying simple functions on raster data: Part 13m 48s
-
(Locked)
Applying simple functions on raster data: Part 23m 57s
-
(Locked)
Applying simple functions on raster data: Part 34m 33s
-
(Locked)
Applying complex functions on raster data4m 55s
-
(Locked)
-