ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • 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

Classify Raster

Available with Spatial Analyst license.

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

Summary

Classifies a raster dataset based on an Esri classifier definition (.ecd) file and raster dataset inputs.

The .ecd file contains all the information needed to perform a specific type of Esri-supported classification. The inputs to this tool must match the inputs used to generate the required .ecd file.

The .ecd file can be generated from any of the classifier training tools, such as Train Random Trees Classifier or Train Support Vector Machine Classifier.

Usage

  • The input raster can be any Esri-supported raster and any valid bit depth.

  • The input .ecd file contains attribute statistics suitable for the appropriate classifier.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Syntax

ClassifyRaster(in_raster, in_classifier_definition, {in_additional_raster})
ParameterExplanationData Type
in_raster

The raster dataset to classify.

Mosaic Layer; Raster Layer; Image Service; String
in_classifier_definition

The input Esri classifier definition (.ecd) file containing the statistics on the chosen attributes for the classifier.

File
in_additional_raster
(Optional)

Incorporate ancillary raster datasets, such as a multispectral image or a DEM, to generate attributes and other required information for the classifier. This raster will be needed when calculating attributes such as mean or standard deviation. This parameter is optional.

Mosaic Layer; Raster Layer; Image Service; String

Return Value

NameExplanationData Type
out_raster_dataset

The path and name of the classified image you are creating.

The output classified raster is defined by the input raster dataset and .ecd file inputs.

Raster

Code sample

ClassifyRaster example 1 (Python window)

This example classifies an input TIFF raster.

# Import system modules
import arcpy
from arcpy.sa import *

classifiedraster = ClassifyRaster("c:/classifydata/moncton_seg.tif", 
                                  "c:/classifydata/moncton_sig.ecd", 
                                  "c:/classifydata/moncton.tif")

classifiedraster.save("c:/test/moncton_classified.tif")
ClassifyRaster example 2 (stand-alone script)

This example classifies an input TIFF raster.

# Import system modules
import arcpy
from arcpy.sa import *


# Set local variables
insegras = "c:/classifydata/moncton_seg.tif"
indef_file = "c:/classifydata/moncton_sig.ecd"
in_additional_raster = "c:/classifydata/moncton.tif"


# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute 
classifiedraster = ClassifyRaster(insegras, indef_file, in_additional_raster)

#save output
classifiedraster.save("c:/test/moncton_classified.tif")

Environments

  • Compression
  • Current Workspace
  • Extent
  • Geographic Transformations
  • NoData
  • Output CONFIG Keyword
  • Output Coordinate System
  • Parallel Processing Factor
  • Pyramid
  • Resampling Method
  • Raster Statistics
  • Scratch Workspace
  • Snap Raster
  • Tile Size

Licensing information

  • Basic: Requires Spatial Analyst
  • Standard: Requires Spatial Analyst
  • Advanced: Requires Spatial Analyst

Related topics

  • An overview of the Segmentation and Classification toolset
  • What is image classification?

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
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal