ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

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
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Classify Raster

Available with Spatial Analyst license.

  • Summary
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Classify 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 need to match the inputs used to generate the required .ecdfile.

Usage

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

  • The input Esri classifier definition (.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

Select the raster dataset you want to classify.

Segmented Raster | Raster Dataset | Mosaic Dataset | Raster Layer | Mosaic Layer | Image Service Layer
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)

Optionally incorporate ancillary raster datasets, such as a segmented image, a multispectral image, or a DEM, to generate attributes and other required information for the classifier. The raster datasets for this parameter must match those used to create the training .ecd file.

Segmented Raster | Raster Dataset | Mosaic Dataset | Raster Layer | Mosaic Layer | Image Service Layer

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

  • Auto Commit
  • Cell Size
  • Compression
  • Current Workspace
  • Extent
  • Geographic Transformations
  • Mask
  • NoData
  • Output CONFIG Keyword
  • Output Coordinate System
  • Pyramid
  • Raster Statistics
  • Scratch Workspace
  • Snap Raster
  • Tile Size

Licensing Information

  • ArcGIS for Desktop Basic: Requires Spatial Analyst
  • ArcGIS for Desktop Standard: Requires Spatial Analyst
  • ArcGIS for Desktop Advanced: Requires Spatial Analyst

Related Topics

  • An overview of the Segmentation and Classification toolset
  • What is image classification?
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

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

About Esri

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