Skip To Content

Convert Raster To Feature

Summary

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

Illustration

Convert Raster to Feature tool

Usage

  • Rasters can be converted to point, line, or polygon features.

Syntax

ConvertRasterToFeature_ra (inputRaster, field, outputType, {simplifyLinesOrPolygons}, outputName)
ParameterExplanationData Type
inputRaster

The input raster layer.

Feature Set
field

Provide a field that specifies which value will be used for the conversion.

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 choice is to use the Value field, which contains the value in each raster cell.

Field
outputType

Choose the output type between point, line, or polygon.

  • POINTThe raster will be converted to a point dataset. This is the default.
  • LINEThe raster will be converted to a line feature dataset.
  • POLYGONThe raster will be converted to a polygon feature dataset.
String
simplifyLinesOrPolygons
(Optional)

Set if lines should be simplified.

  • SIMPLIFYThe line or polygon features will be smoothed out to produce a more generalized result. This is the default.
  • NO_SIMPLIFYThe line or polygon features will follow the cell boundaries of the raster dataset.

This parameter is only supported if the outputType is line or polygon.

Boolean
outputName

The output feature class that will contain the converted point, line or polygons.

String

Derived Output

NameExplanationData Type
outputFeatures

The output features.

Feature Class

Code sample

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)

Licensing information

  • Basic: Requires ArcGIS Image Server
  • Standard: Requires ArcGIS Image Server
  • Advanced: Requires ArcGIS Image Server

Related topics