Find Local Peaks Or Valleys (Defense)

Available with Advanced license.

Available with Spatial Analyst license.


Finds local peaks or valleys within a defined area.


  • The number of highest or lowest point features returned may be less than requested in the Number of Peaks or Valleys parameter. The tool will only return the number of local peaks or valleys that can be identified given the input surface.

  • Peaks are found by inverting the surface and then finding the sinks in the surface. These points are used to extract elevation values from the original surface and are sorted based on elevation.

  • The elevation of the Input Surface is used to rank points, but the number returned is based on the sorted order of elevation values. If you choose the highest 10 points and points 10, 11, and 12 have the same elevation, the tool excludes the latter two.

  • This tool finds local maximums or minimums in an area; for example, the top of a small hill in the middle of a valley surrounded by high mountains will be identified as a local peak.

  • The output contains an Elevation field with the elevation value of the peaks or valleys. The units of the peaks or valleys are the z-units (elevation) of the input surface. Check the input surface metadata for this unit.


FindLocalPeaksValleys(in_surface, out_feature_class, peak_valley_op_type, num_peaks_valleys, {in_feature})
ParameterExplanationData Type

The input elevation raster surface.

Raster Layer

The output point feature class containing the local peaks or valleys.

Feature Class

Specifies the type of operation the tool will perform.

  • PEAKSLocal peaks will be found. This is the default.
  • VALLEYSLocal valleys will be found.

The number of peaks or valleys to find.


The input polygon feature class in which the local peaks or valleys will be found.

Feature Set

Code sample

FindLocalPeaksValleys example 1 (Python window)

The following Python window script demonstrates how to use the FindLocalPeaksValleys function.

import arcpy
arcpy.env.workspace = r"C:/Data.gdb"
FindLocalPeaksValleys example 2 (stand-alone script)

The following example uses the FindLocalPeaksValleys function in a sample workflow script.

# Description: Find the highest peak in Crowders State Park.

# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = r"C:/Data.gdb"

# Select state park
state_parks = "NCStateParks"
whereClause = "st_park_name = 'Crowders Mountain State Park'"
aoi_layer = arcpy.SelectLayerByAttribute_management(state_parks,

# Inputs
input_surface = "n36.dt2"

# Find highest peak 


This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: No
  • Advanced: Yes

Related topics