Find Local Peaks Or Valleys (Defense)

Available with Advanced license.

Available with Spatial Analyst license.

Summary

Finds local peaks or valleys within a defined area.

Usage

  • 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.

Parameters

LabelExplanationData Type
Input Surface

The input elevation raster surface.

Raster Layer; Mosaic Dataset; Mosaic Layer
Output Feature Class

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

Feature Class
Peaks or Valleys

Specifies the type of operation the tool will perform.

  • Local peaksLocal peaks will be found. This is the default.
  • Local valleysLocal valleys will be found.
String
Number of Peaks or Valleys

The number of peaks or valleys to find.

Long
Input Area
(Optional)

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

Feature Set

arcpy.defense.FindLocalPeaksValleys(in_surface, out_feature_class, peak_valley_op_type, num_peaks_valleys, {in_feature})
NameExplanationData Type
in_surface

The input elevation raster surface.

Raster Layer; Mosaic Dataset; Mosaic Layer
out_feature_class

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

Feature Class
peak_valley_op_type

Specifies the type of operation the tool will perform.

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

The number of peaks or valleys to find.

Long
in_feature
(Optional)

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"
arcpy.defense.FindLocalPeaksValleys("n36.dt2",
                                    "n36_FindLocalPeaksValleys",
                                    "PEAKS",
                                    10,
                                    "SelectedAOI")
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.management.SelectLayerByAttribute(state_parks,
                                                    "NEW_SELECTION",
                                                    whereClause)

# Inputs
input_surface = "n36.dt2"

# Find highest peak 
arcpy.defense.FindLocalPeaksValleys(input_surface,
                                    "PeaksCrowdersMtn",
                                    "PEAKS",
                                    10,
                                    aoi_layer)

Licensing information

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

Related topics