How to create a Geospatial Raster from a projected Reservoir with Python and hatariTools - Tutorial

The task to modify geospatial rasters considering future elements can be a complex task with the available GIS tools. We have optimized the way we can represent the surface of future (or current) water reservoirs on a fully geospatial raster. This tutorial shows the complete process to create a geospatial raster (TIF file) based on the contours from the dam and the reservoir extension.

Tutorial

Code

#!pip install hatariTools
from hatariTools.geospatialTools.rasterTools import modifyRasterwithRasterOnMask, modifyRasterwithElevOnMask
wholeRasterPath = "../rst/tsfDem10m.tif"
partialRasterPath = "../output/damElev.tif"
maskLayerPath = "../shp/damEnvelope_v2.shp"
modifiedRasterPath = "../output/demWithDam.tif"
modifyRasterwithRasterOnMask(wholeRasterPath,
                             partialRasterPath,
                             maskLayerPath,
                             modifiedRasterPath)
wholeRasterPath = "../output/demWithDam.tif"
elevValue = 670
maskLayerPath = "../shp/tailingsEnvelope_v2.shp"
modifiedRasterPath = "../output/demWithReservoir.tif"
modifyRasterwithElevOnMask(wholeRasterPath,
                           elevValue,
                           maskLayerPath,
                           modifiedRasterPath)

Input data

You can download the input data from this link.