Convert Raster To Feature (Raster Analysis)

Title  Convert Raster To Feature (Raster Analysis)

Summary

Converts a raster to a feature dataset, as points, lines, or polygons.


Illustration

Convert Raster To Feature tool Convert Raster To Feature tool

Usage


Syntax

Parameter Explanation
inputRaster

The input raster layer.

field

A field that specifies the conversion value.

It can be any integer or text value.

A field containing floating-point values can only be used if the output is to a point dataset.

The default is the Value field, which contains the value in each raster cell.

outputType

Specifies the output type.

  • Point—The raster will be converted to a point dataset. This is the default.
  • Line—The raster will be converted to a line feature dataset.
  • Polygon—The raster will be converted to a polygon feature dataset.

If the output type is Line or Polygon, an additional parameter appears allowing the simplification of lines or polygons.

simplifyLinesOrPolygons (Optional)

Specifies whether lines or polygons will be simplified (smoothed). The smoothing is done in such a way that the line contains a minimum number of segments while remaining as close as possible to the original raster cell edges.

  • Checked—The line or polygon features will be smoothed to produce a more generalized result. This is the default.
  • Unchecked—The line or polygon features will not be smoothed and will follow the cell boundaries of the raster dataset.
outputName

The output feature class that will contain the converted points, lines, or polygons.

createMultipartFeatures (Optional)

Specifies whether the output polygons will consist of single-part or multipart features.

  • Checked— Multipart features will be created based on polygons that have the same value.
  • Unchecked— Individual (single-part) features will be created for each polygon. This is the default.
maxVerticesPerFeature (Optional)

The vertex limit used to subdivide a polygon into smaller polygons. This parameter produces similar output as that created by the Dice tool in the Data Management toolbox.

If left empty, the output polygons will not be split. This is the default.

This parameter is only supported if Output Type is Polygon.

Code Samples

ConvertRasterToFeature example 1 (Python window)

This example converts a raster to polygon features.


import arcpy
arcpy.ConvertRasterToFeature_ra('https://MyPortal.esri.com/server/rest/services/Hosted/Landuse/ImageServer', 
                                'Value', 'POLYGON', 'SIMPLIFY', 'outFeatures')

                    

ConvertRasterToFeature example 2 (stand-alone script)

This example converts a raster to polygon features.


#-------------------------------------------------------------------------------
# Name: ConvertRasterToFeature_Ex_02.py
# Description: Convert a raster to polygon features.
#
# Requirements: ArcGIS Image Server

# Import system modules
import arcpy

# Set local variables
inRaster = 'https://MyPortal.esri.com/server/rest/services/Hosted/Landuse/ImageServer'
inField = 'Value'
outType = 'POLYGON'
simplify = 'SIMPLIFY'
outFeatures = 'outFeatures'
arcpy.ConvertRasterToFeature_ra(inRaster, inField, outType, simplify, outFeatures)

                    

Tags

Credits

Use limitations