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

Usage

  • This raster analysis portal tool is available when you are signed in to an ArcGIS Enterprise Link to Understanding analysis in ArcGIS Enterprise portal that has an ArcGIS Image Server Link to What is ArcGIS Image Server configured for Raster Analysis Link to Configure and deploy raster analytics. When the tool is invoked, ArcGIS Pro serves as a client and the processing occurs in the servers federated with ArcGIS Enterprise. The portal tool accepts layers from your portal as input and creates output in your portal.

    The input raster layer supports a layer from the portal, a URI or URL to an image service, or the output from the Make Image Server Layer tool. This tool does not support local raster data or layers.

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

Parameters

LabelExplanationData Type
Input Raster Layer

The input raster layer.

Feature Set
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.

Field
Output Type

Specifies the output type.

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

  • 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
Simplify Lines or Polygons
(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.
Boolean
Output Name

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

String
Create Multipart Features
(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.
Boolean
Maximum Vertices Per Polygon Feature
(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.

Long

Derived Output

LabelExplanationData Type
Output Feature

The output features.

Feature Class

arcpy.ra.ConvertRasterToFeature(inputRaster, field, outputType, {simplifyLinesOrPolygons}, outputName, {createMultipartFeatures}, {maxVerticesPerFeature})
NameExplanationData Type
inputRaster

The input raster layer.

Feature Set
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.

Field
outputType

Specifies the output type.

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

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.

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

This parameter is only supported if outputType is LINE or POLYGON.

Boolean
outputName

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

String
createMultipartFeatures
(Optional)

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

  • MULTIPLE_OUTER_PARTMultipart features will be created based on polygons that have the same value.
  • SINGLE_OUTER_PARTIndividual (single-part) features will be created for each polygon. This is the default.

This parameter is only supported if outputType is POLYGON.

Boolean
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 outputType is POLYGON.

Long

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