Zusammenfassung
Creates and smooths contours from an input raster.
Verwendung
Set the Map Scale parameter to the scale that your cartographic products will print. The tool uses this parameter to improve contour display in output products.
This tool requires specific fields in the Out Contour Features parameter value. The Out Contour Features parameter value should be a Defense Mapping data model feature class.
This tool uses the following process to generate contours:
- Create contours by executing the Spatial Analyst Contour tool.
- Smooth contours by applying a Defense Mapping-specific algorithm.
- Calculate contour fields that pertain to Defense Mapping data models.
Syntax
arcpy.defense.CreateContours(Input_Raster, Map_Scale, Base_Contour, Contour_Interval, Index_Interval, Include_Zero_Contour, Out_Contour_Features, Contour_Subtype, {Input_Area_of_Interest}, {Raster_Elevation_Units}, {Contour_Elevation_Units}, {Resample_Raster})| Parameter | Erklärung | Datentyp |
Input_Raster [Input_Raster,...] | A list of rasters from which contours will be created. | Raster Layer |
Map_Scale | Specifies the scale at which the cartographic product will be printed. The tool optimizes cartographic display by setting a minimum feature length based on this scale.
| String |
Base_Contour | The base contour value. Contours are generated above and below this value to cover the entire value range of the input raster. Setting this value to 5 and the contour interval to 10 will produce contour lines at 5, 15, 25, -5, -15, and so on. The default is zero. | Double |
Contour_Interval | The interval, or distance, between contour lines. The value can be any positive number. | Double |
Index_Interval | The index contour interval. | Double |
Include_Zero_Contour | Specifies whether the tool will create a zero contour. A zero contour represents sea level. When generated along a coastline, zero contours can be created inside a water body. Specify INCLUDE_ZERO_CONTOUR if you will generate contours on land areas that are at or below sea level.
| Boolean |
Out_Contour_Features | A feature layer from an existing Defense Mapping feature class. This tool appends contours to this feature class and returns a feature layer. | Feature Layer |
Contour_Subtype | A subtype of the Out_Contour_Features parameter value to which contours will be written. | String |
Input_Area_of_Interest (optional) | An area of interest (AOI) that is contained in a raster and is used to clip the raster before creating contours. A buffer is created before clipping the raster and results in larger output contours that extend beyond the selected AOI. | Feature Layer |
Raster_Elevation_Units [Raster_Elevation_Units,...] (optional) | Specifies the measurement units for elevation values in the Input_Raster parameter.
| String |
Contour_Elevation_Units [Contour_Elevation_Units,...] (optional) | Specifies the contour elevation units. The contour elevation units will be created with the same elevation units as raster values unless specified otherwise, such as feet instead of meters.
| String |
Resample_Raster (optional) | Specifies whether the Input_Raster parameter value will be resampled before contours are created.
| Boolean |
Codebeispiel
CreateContours example (Python window)
The following Python window script demonstrates how to use the CreateContours function.
# set gp environment
arcpy.env.workspace="C:/data"
# variables for tool
rasters="elevation.tif"
mapScale="1:12500"
baseContour=0
contourInterval=10
# output feature class must exist
outContours="mgcp.gdb/mgcp/contours"
noIdx="NO_INDEX_CONTOURS"
contourSubtype="FCSubtype"
# execute the tool
arcpy.CreateContours_defense(rasters,mapScale,baseContour,contourInterval,outContours,contourSubtype)
Umgebungen
Lizenzinformationen
- Basic: Nein
- Standard: Nein
- Advanced: Erfordert Defense Mapping and Spatial Analyst