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

Extract SubDataset

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

Summary

Creates a new raster dataset from a selection of an HDF or NITF dataset.

Usage

  • Subdataset file formats can be either Hierarchical Data Format (HDF) or National Imagery Transmission Format (NITF) files

  • The data structure allows the file format to consist of multiple datasets in one parent file. In addition, each of the subdatasets can consist of one band or multiple bands.

  • If you do not choose any subdatasets, the default will be to only return the first subdataset.

  • When storing your raster dataset to a JPEG file, a JPEG 2000 file, or a geodatabase, you can specify a Compression type and Compression Quality within the Environment Settings.

  • The GIF format does not support multiband; therefore, it is not a valid output format unless your raster dataset is single band.

Syntax

ExtractSubDataset_management (in_raster, out_raster, {subdataset_index})
ParameterExplanationData Type
in_raster

The HDF or NITF dataset that has the layers you want to extract.

Raster Layer
out_raster

The name, location, and format for the dataset you are creating.

When storing the raster dataset in a file format, you need to specify the file extension:

  • .bil—ESRI BIL
  • .bip—ESRI BIP
  • .bmp—BMP
  • .bsq—ESRI BSQ
  • .dat—ENVI DAT
  • .gif—GIF
  • .img—ERDAS IMAGINE file
  • .jpg—JPEG
  • .jp2—JPEG 2000
  • .png—PNG
  • .tif—TIFF
  • no extension—ESRI GRID.

When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset.

When storing your raster dataset to a JPEG file, a JPEG 2000 file, or a geodatabase, you can specify a Compression type and Compression Quality within the Environment Settings.

Raster Dataset
subdataset_index
[subdataset_index,...]
(Optional)

The subdatasets that you want to extract.

Value Table

Code sample

ExtractSubDataset example 1 (Python window)

This is a Python sample for ExtractSubDataset

import arcpy
arcpy.ExtractSubDataset_management("c:/data/MyNITF.ntf","extracted.tif", "2")
ExtractSubDataset example 2 (stand-alone script)

This is a Python script sample for ExtractSubDataset

##====================================
##Extract Subdataset
##Usage: ExtractSubdataset_management in_raster out_raster {ID;ID...}

import arcpy
arcpy.env.workspace = r"C:/Workspace"

##Extract 3-band subdataset from HDF
arcpy.ExtractSubDataset_management("MHDF.hdf", "subds.tif", "5;6;7")

##Extract 1-band subdataset from NITF
arcpy.ExtractSubDataset_management("MNITF.ntf","subds_ntf.tif", "2")

Environments

  • Compression
  • Current Workspace
  • NoData
  • Output CONFIG Keyword
  • Output Coordinate System
  • Extent
  • Pyramid
  • Raster Statistics
  • Resampling Method
  • Scratch Workspace
  • Snap Raster

Licensing information

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

Related topics

  • An overview of the Raster toolset
  • Environment settings for raster data
  • Raster data with subdatasets
  • Extracting subdatasets from the parent file

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
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal