## 2 Methods
### Implementation Process
#### 2.2.4. Region Merging and Post-Processing  
The catchment regions obtained from the previous step typically exhibit excessive fragmentation compared to actual slope units, necessitating a hierarchical aggregation process to merge adjacent sub-catchments belonging to homogeneous terrain regions. This consolidation procedure comprises four critical stages:  
Stage 1: A 4-directional connectivity labeling algorithm is employed to identify and encode individualized catchment regions within the binary watershed framework. This process systematically assigns unique identifiers to each contiguous region through horizontal and vertical pixel adjacency analyses (excluding diagonal connections) while recording their spatial coordinates for subsequent processing. Building upon these labeled regions, a graph-theoretic approach constructs an adjacency matrix that represents the topological relationships between neighboring catchments. Each matrix element encodes whether two regions share a common boundary (edge adjacency) or contain spatially proximate but non-adjacent cells (node connectivity), thereby establishing a network structure that preserves both the hydrological connectivity and geometric integrity of the merged slope units. This step lays the foundation for downstream analyses requiring the quantitative characterization of watershed hierarchies and flow path dynamics.  
Stage 2: The identified catchment regions are mapped onto the corresponding flow direction and slope gradient grids using their encoded identifiers and spatial coordinates. For each catchment, we compute the mean flow direction and the mean slope orientation:  
\[mean=arctan\frac{\frac{\sum\limits_{i=1}^{n}cosx}{n}}{\frac{\sum\limits_{i=1}^ {n}sinx}{n}} \tag{2}\]  
where \(n\) is the total number of grid cells within the catchment and \(x\) represents individual grid values of the flow direction or slope orientation. This calculation aggregates directional vectors to determine the dominant flow orientation or slope orientation.  
These directional metrics are subsequently classified into eight principal compass sectors (N, NE, E, SE, S, SW, W, and NW) using standard octant partitioning (45\({}^{\circ}\) angular intervals). This categorization establishes hydrological parameters (flow convergence patterns) and mechanical indices (slope stability indicators) critical for terrain analysis. The results provide quantifiable foundations for geomorphic process modeling and landslide susceptibility assessments.  
Stage 3: Using the adjacency topology matrix established in Stage 1, we perform hydrological-hydraulic equivalence checks between all neighboring catchment regions. Ifadjacent catchments exhibit identical mean flow direction (\(\theta\)) and slope gradient (\(m\)) values (i.e., \(\theta_{i,j}=\theta_{k,l}\)_and_\(m_{i,j}=m_{k,l}\) for neighboring regions (\(i,j\)) and (\(k,l\))), their shared boundary is removed through topological fusion. This process merges contiguous catchments into unified grid-based slope units while preserving the inherent hydrological continuity of the terrain. The resultant merged units represent physically coherent regions with homogeneous water flow behavior and mechanical stability characteristics, forming the final product for geomorphic analysis and engineering applications.  
Stage 4: Building upon the grid-based slope units generated in Stage 3, we conduct vectorization using the ArcGIS 10.8 software. Direct raster-to-vector conversion often introduces artifacts such as aliasing patterns and orphaned polygons due to the discrete nature of grid data. To mitigate these issues, our method employs topological cleaning operations through the \"Eliminate\" toolset. This step establishes a bridge between raster-based hydrological analyses and vector-based geomorphic modeling applications.