# How to extract mountain peak points from a given digital elevation model?

For past couple of days, i m trying to determine how many mountain peaks are visible (line of sight) from a given location using POSTGIS.

The data i have is DEM for Swiss and address locations from Swiss which are stored in a table in postgis database. I downloaded the mountain peak points from OSM(Open street Map), and then wrote a function in postgis to find if the peak is visible from a given address location using address data from the table, elevation raster(imported in the postgis db), and mountain peak data imported from OSM to POSTGIS...

The Funtion is giving me output but the quality of the results are very poor as OSM mountain peaks are not proper and are not aligned to the mountain peak points in the elevation raster(problem with OSM data Quality). projections are matching of both the layers.. so now to solve this problem i need to get the exact mountain peaks. So i was just wondering if i can extract mountain peaks from elevation raster. with it co-ordinates n elevation.. which i can then used to calculate Line of sight...

• It takes some art to do this well, because different landscape types require different operational definitions of "mountain peak." A simple, quick way to identify possible peaks is to compare the DEM to a focal maximum (as illustrated at gis.stackexchange.com/a/50190/664): a "peak" occurs wherever the two rasters agree. By using this comparison as the zone grid in a zonal summary of coordinate grids, you can just as easily and quickly extract all the coordinates of these peaks. – whuber Nov 15 '13 at 15:55
• I already have peak values which i got from OSM but the problem is that the co-ordinates in OSM data are approximate which i cant use to find the line of sight.. That is the reason i m trying to find some mathematical/geometrical expression which can determine the peak points. 1 method i figured is.. I can find the peak points by generating Contour from the DEM of min interval and then use centroid pt of the contour line with max elevation and min area as the peak points of different classification but i know it will be very time consuming n heavy on CPU consumption. – Yogendra Nov 16 '13 at 5:32
• gis.stackexchange.com/questions/84043/… – user31059 Jun 5 '14 at 14:41

There are probably a few different ways to do this. I can think of two here. Someone else can probably find a more elegant solution.

1.) If there are not many peaks, or if your study area is small, you could simply extract the peaks manually by viewing them in any GIS software. Simply add a point at every peak, use a function to assign the raster value (elevation) to the point attribute table, and you are done.

2.) If there are many peaks, or if your study area is large, you could reclass the DEM so that everything below a certain value is null and everything above a certain value is "1". That value is best based off your knowledge of the study area. The goal would be to find a value that nulls almost all of the DEM, leaving only the highest areas of peaks as "1". Once you have your Null, 1 raster simply convert 1 values to polygons and then take the geometric center of those polygons as peak locations. Assign the peak points the value taken from the original DEM raster and you are done. This method won't be exact, since we are assuming that the center of the "peak" polygons is the actual highest point.

• To improve on method 2) you could also find the highest elevation value in each 'peak' after nulling the lower values, rather than just using the centroid. – Darren Cope Nov 15 '13 at 13:20
• Thanks for a quick reply.. I already have peak values which i got from OSM but the problem is that the co-ordinates in OSM data are approximate which i cant use to find the line of sight.. That is the reason i m trying to find some mathematical/geometrical expression which can determine the peak points. 1 method i figured is.. I can find the peak points by generating Contour from the DEM of min interval and then use centroid pt of the contour line with max elevation and min area as the peak points of different classification but i know it will be very time consuming n heavy on CPU consumption. – Yogendra Nov 16 '13 at 5:33

There's a really good academic GIS paper on this topic:

Chaudhry, O. Z., & Mackaness, W. A. (2008). Creating Mountains out of Mole Hills: Automatic Identification of Hills and Ranges Using Morphometric Analysis. Transactions in GIS, 12(5), 567–589. www.geos.ed.ac.uk/homes/wam/ChaudMackTrans2008.pdf

I am getting your point but can you just elaborate your conclusion and expectation?.

I got https://stackoverflow.com/questions/9074202/opencv-2-centroid to calculate centroid for contour..