ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Raster to Polygon

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Converts a raster dataset to polygon features.

Usage

  • The input raster can have any cell size and must be a valid integer raster dataset.

  • The Field parameter allows you to choose which attribute field of the input raster dataset will become an attribute in the output feature class. If a field is not specified, the cell values of the input raster (the VALUE field) will become a column with the heading Gridcode in the attribute table of the output feature class.

  • The following graphic illustrates how the input raster is vectorized when it is converted to a polygon feature output. The result is presented for both the settings of the Simplify parameter.

    Illustration of output with different simplify options
    Comparing the output with different simplify options

Syntax

RasterToPolygon_conversion (in_raster, out_polygon_features, {simplify}, {raster_field})
ParameterExplanationData Type
in_raster

The input raster dataset.

The raster must be integer type.

Raster Layer
out_polygon_features

The output feature class that will contain the converted polygons.

Feature Class
simplify
(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. The smoothing is done in such a way that the polygons contain a minimum number of segments while remaining as close as possible the original raster cell edges. This is the default.
  • NO_SIMPLIFY —The edge of the polygons will conform exactly to the input raster's cell edges. With this option, converting the resulting polygon feature class back to a raster would produce a raster the same as the original.
Boolean
raster_field
(Optional)

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

It can be an integer or a string field.

Field

Code sample

RasterToPolygon example (Python window)

Converts a raster dataset to polygon features.

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.RasterToPolygon_conversion("zone", "c:/output/zones.shp", "NO_SIMPLIFY",
                                  "VALUE")
RasterToPolygon example (stand-alone script)

Converts a raster dataset to polygon features.

# Name: RasterToPolygon_Ex_02.py
# Description: Converts a raster dataset to polygon features.
# Requirements: None

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# Set local variables
inRaster = "zone"
outPolygons = "c:/output/zones.shp"
field = "VALUE"

# Execute RasterToPolygon
arcpy.RasterToPolygon_conversion(inRaster, outPolygons, "NO_SIMPLIFY", field)

Environments

  • Auto Commit
  • Current Workspace
  • Default Output Z Value
  • Extent
  • Geographic Transformations
  • M Resolution
  • M Tolerance
  • Maintain Spatial Index
  • Output CONFIG Keyword
  • Output Coordinate System
  • Output has M values
  • Output has Z values
  • Output M Domain
  • Output XY Domain
  • Output Z Domain
  • Scratch Workspace
  • Snap Raster
  • XY Resolution
  • XY Tolerance
  • Z Resolution
  • Z Tolerance

Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics

  • About converting from raster data
  • Polygon to Raster

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal