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.

Comment

Saul Montoya

Saul Montoya es Ingeniero Civil graduado de la Pontificia Universidad Católica del Perú en Lima con estudios de postgrado en Manejo e Ingeniería de Recursos Hídricos (Programa WAREM) de la Universidad de Stuttgart con mención en Ingeniería de Aguas Subterráneas y Hidroinformática.

 

Suscribe to our online newsletter

Subscribe for free newsletter, receive news, interesting facts and dates of our courses in water resources.