Fill pits with Python DEM data

1. Introduction

The first step in hydrological terrain analysis is to remove pits, which is conducive to subsequent analysis of influencing factors such as hydrological flow direction of DEM data. As shown in the image below, a dimple in a terrain is defined as one or more grid cells completely surrounded by higher ground. So here a fill process is used to raise the height of the pit until the grid is about the same height as the surrounding grid.

Two, implement the code

basic part

basictype.py

import rasterio
import numpy as np
import warnings
from affine import Affine

Guess you like

Origin blog.csdn.net/dayuhaitang1/article/details/131057796