Spatial Analyst and Hydrology tools can be used to identify and extract dividing lines (of mountains) from an elevation raster (DEM), this by creating a network of flows by inverting the values of a DEM.
If at any time you are interested in finding a way to identify the ridges or edges of a mountain, the procedure is shown below. ArcMap is used in this input, but following the same principles can be used in other applications such as ArcGIS Pro or QGIS.
Before you start, make sure to correct the DEM with the Fill tool located on:
ArcToolbox > Spatial Analyst > Hydrology >
Now reverse the DEM values with the help of the Raster Calculator tool. It is an extremely simple process, simply multiply by -1. The Raster Calculator tool can be located at:
ArcToolbox > Spatial Analyst > Map Algebra >
With the Flow Direction tool use the inverted DEM as input data, select the “Force all edge cells to flow outward” checkbox. The Flow Direction tool is located in:
ArcToolbox > Spatial Analyst > Hydrology >
Using the same ArcToolbox address, the Flow Accumulation tool is executed using the previously generated accumulation raster as input data. Be sure to set the output data type to Integer instead of Float.
Configure the raster threshold created with Flow Accumulation and create the flow network with Raster Calculator using the following expression:
Con(“FlowAcc”,1,0, “Value >= 2500”)
Note: The value of 2500 must be replaced according to the spatial extension of the study area, and the density of the network of ridges to be identified. For example, in this case if I want only the main ridges I would increase the value to 10000, but if I want a very dense net under the value to 500. In each case it is recommended to test different values, until the desired result is obtained.
If everything goes well, you should get an image similar to the next one:
Now to transform the raster image into a vector it is necessary to create the flow orders. To do this use the Stream Order tool, use the ridge raster and the direction raster as input data, this tool is located in:
ArcToolbox > Spatial Analyst > Hydrology >
To transform into a vector use the Stream To Feature tool located in:
ArcToolbox > Spatial Analyst > Hydrology >
Finally, if everything went well, you will get an image like the one shown below. It should also be considered that this process uses the same principle to calculate a water network, but in this case it is inverted and with difficulty the whole network will be connected.