Raster To Polygon (Conversion)

Converts a raster dataset to polygon features.


Usage Tips

Syntax

RasterToPolygon_conversion (in_raster, out_polygon_features, simplify, raster_field)
Parameter Explanation Datatype
Input raster (Required)

The input integer raster dataset.

Composite Geodataset
Output polygon features (Required)

The output feature class that will contain the converted polygons.

Feature Class
Simplify polygons (Optional)

Determines if the output polygons will be smoothed into simpler shapes or conform to the input raster's cell edges.

  • SIMPLIFY—The polygons will be smoothed into simpler shapes. This is the default.
  • NO_SIMPLIFY—The polylines will conform to the input raster's cell edges.

Boolean
Field (Optional)

The field used to assign values from the cells in the input raster to the polygon features in the output dataset.

It can be an integer or a string field.

Field
Data types for geoprocessing tool parameters

Script Example

# RasterToPolygon_sample.py
# Description: 
#   Converts a raster to polygon features.
# Requirements: None
# Author: ESRI
# Date: Oct 20, 2005

# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set local variables
    InRaster = "C:/data/raster1"
    OutPolygonFeatures = "C:/data/raster2polygon.shp"

    # Process: RasterToPolygon_conversion
    gp.RasterToPolygon_conversion(InRaster, OutPolygonFeatures, "NO_SIMPLIFY")

except:
    # Print error message if an error occurs
    print gp.GetMessages()

Map Algebra syntax

See GridShape.

The Spatial Analyst extension must be present to use this link.


ArcObjects syntax

See RasterDataToPolygonFeatureData.

The Spatial Analyst extension must be present to use this link.


See Also

  • Raster to Polyline (Conversion)
  • Feature to Raster (Conversion)