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

Thin

Available with Spatial Analyst license.

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

Summary

Thins rasterized linear features by reducing the number of cells representing the width of the features.

Usage

  • A typical application for the Thin tool is for processing a scanned elevation contour map. Because of the resolution of the scanner and the width of the lines on the original map, the contours are represented in the resulting raster as linear elements from five to ten cells wide. After running Thin, each contour will be represented as a linear feature of a single cell width.

  • If enabled, the filter option uses the same filtering algorithm as the Boundary Clean tool to remove short linear features extending from the major branch. It can also remove features narrower than three cells.

  • Specifying the maximum thickness of input linear features is essential for thinning rasters where the thickness of linear features may exceed or stay below the default maximum thickness value. The best results can be expected when the maximum thickness fits the thickest linear features to be thinned.

  • The general algorithm used in the Thin tool is detailed in the following:

    Zhan, Cixiang, 1993, A Hybrid Line Thinning Approach, Proceedings Auto-Carto 11, Minneapolis , pp. 396-405

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

Syntax

Thin (in_raster, {background_value}, {filter}, {corners}, {maximum_thickness})
ParameterExplanationData Type
in_raster

The input raster to be thinned.

It must be of integer type.

Raster Layer
background_value
(Optional)

Specifies the cell value that will identify the background cells. The linear features are formed from the foreground cells.

  • ZERO — The background is composed of cells of 0 or less, or NoData. All cells whose value is greater than 0 are the foreground.
  • NODATA — The background is composed of NoData cells. All cells with valid values belong to the foreground.
String
filter
(Optional)

Specifies whether a filter will be applied as the first phase of thinning.

  • NOFILTER — No filter will be applied. This is the default.
  • FILTER — The raster will be filtered to smooth the boundaries between foreground and background cells. This option will eliminate minor irregularities from the output raster.
Boolean
corners
(Optional)

Specifies whether round or sharp turns will be made at turns or junctions.

It is also used during the vector conversion process to spline curves or create sharp intersections and corners.

  • ROUND — Attempts to smooth corners and junctions. This is best for vectorizing natural features, such as contours or streams.
  • SHARP — Attempts to preserve rectangular corners and junctions. This is best for vectorizing man-made features such as streets.
String
maximum_thickness
(Optional)

The maximum thickness, in map units, of linear features in the input raster.

The default thickness is ten times the cell size.

Double

Return Value

NameExplanationData Type
out_raster

The output thinned raster.

The output is always of integer type.

Raster

Code Sample

Thin example 1 (Python window)

This example thins a raster where the background values are NoData, and smooths the boundaries while attempting to preserve corners and junctions.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
thinOut = Thin("land","NODATA", "FILTER", "SHARP", 300)
thinOut.save("c:/sapyexamples/output/thinout")
Thin example 2 (stand-alone script)

This example thins a raster where the background values are NoData, and smooths the boundaries while attempting to preserve corners and junctions.

# Name: Thin_Ex_02.py
# Description: Thins rasterized linear features by 
#              reducing the number of cells 
#              representing the width of the features.
# Requirements: Spatial Analyst Extension

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

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

# Set local variables
inRaster = "land"
tolerance = 300

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

# Execute Thin
thinOut = Thin(inRaster, "NODATA", "FILTER", "SHARP", tolerance)

# Save the output 
thinOut.save("c:/sapyexamples/output/thinoutput")

Environments

  • Auto Commit
  • Cell Size
  • Compression
  • Current Workspace
  • Extent
  • Geographic Transformations
  • Mask
  • Output CONFIG Keyword
  • Output Coordinate System
  • Extent
  • 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 Generalization toolset
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