Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > Raster toolset > Raster Dataset toolset > Tools

Copy Raster (Data Management)

Release 9.3
Last modified March 8, 2012
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

NOTE: This topic was updated for 9.3.1.


Makes a copy of a raster dataset or loads raster datasets into a raster catalog


Usage tips

Command line syntax
An overview of the Command Line window
CopyRaster_management <in_raster> <out_rasterdataset> {config_keyword} {background_value} {nodata_value} {NONE | OneBitTo8Bit} {NONE | ColormapToRGB} {1_BIT | 2_BIT | 4_BIT | 8_BIT_UNSIGNED | 8_BIT_SIGNED | 16_BIT_UNSIGNED | 16_BIT_SIGNED | 32_BIT_UNSIGNED | 32_BIT_SIGNED | 32_BIT_FLOAT | 64_BIT}

Parameter Explanation Data Type
<in_raster>

The name and location of the raster dataset to be copied.

Raster layer
<out_rasterdataset>

The name and location of the raster dataset to be created.

When storing a raster dataset in a geodatabase (personal, file, or ArcSDE), no file extension should be added to the name of the raster dataset. When storing the raster dataset in a file format, you need to specify the file extension: .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for TIFF, or no extension for GRID.

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.

Raster dataset | Raster catalog
{config_keyword}

Specifies the storage parameters (configuration) for a file geodatabase and an ArcSDE geodatabase. Personal geodatabases do not use configuration keywords.

ArcSDE configuration keywords are set up by your database administrator.

String
{background_value}

Use this option after rotating or projecting an image to remove the unwanted values created around the original raster data. The value specified will be distinguished from other valuable data in the raster dataset. For example, a value of zero along the raster dataset's borders will be distinguished from zero values within the raster dataset.

The pixel value specified will be set to NoData in the output raster dataset.

For file-based rasters and personal geodatabase rasters, the Ignore Background Value must be set to the same value as NoData in order for the background value to be ignored. File geodatabase rasters and SDE rasters will simply work without this extra step.

Double
{nodata_value}

All the pixels with the specified value will be set to NoData in the output raster dataset.

Double
{NONE | OneBitTo8Bit}

Choose whether the input 1-bit raster dataset will be converted to an 8-bit raster dataset. In this conversion, the value 1 in the input raster dataset will be changed to 255 in the output raster dataset. This is useful when importing a 1-bit raster dataset to ArcSDE. One-bit raster datasets have 8-bit pyramid layers when stored in a file system; but in ArcSDE, 1-bit raster datasets can only have 1-bit pyramid layers, which makes the display unpleasant. By converting the data to 8-bit in ArcSDE, the pyramid layers are built as 8-bit instead of 1-bit, resulting in a proper raster dataset in the display.

  • NONE — No conversion will be done. This is the default.
  • OneBitTo8Bit — The input raster will be converted.

Boolean
{NONE | ColormapToRGB}

If the input raster dataset has a color map, the output raster dataset can be converted to a three-band output raster dataset. This is useful when mosaicking rasters with different color maps.

  • NONE — No conversion will occur. This is the default.
  • ColormapToRGB — The input dataset will be converted.

Boolean
{1_BIT | 2_BIT | 4_BIT | 8_BIT_UNSIGNED | 8_BIT_SIGNED | 16_BIT_UNSIGNED | 16_BIT_SIGNED | 32_BIT_UNSIGNED | 32_BIT_SIGNED | 32_BIT_FLOAT | 64_BIT}

Determines the bit depth of the output raster dataset. If left unspecified, the output bit depth will be the same as the input.

There will be no rescaling of the raster values when a different pixel type is chosen. If the pixel type is demoted (lowered), the raster values outside the valid range for that pixel depth will be truncated and lost.

  • 1_BIT — A 1-bit unsigned integer. The values can be 0 or 1.
  • 2_BIT — A 2-bit unsigned integer. The values supported can be from 0 to 3.
  • 4_BIT — A 4-bit unsigned integer. The values supported can be from 0 to 15.
  • 8_BIT_UNSIGNED — An unsigned 8-bit data type. The values supported can be from 0 to 255.
  • 8_BIT_SIGNED — A signed 8-bit data type. The values supported can be from – 128 to 127.
  • 16_BIT_UNSIGNED — A 16-bit unsigned data type. The values can range from 0 to 65,535.
  • 16_BIT_SIGNED — A 16-bit signed data type. The values can range from – 32,768 to 32,767.
  • 32_BIT_UNSIGNED — A 32-bit unsigned data type. The values can range from 0 to 4,294,967,295.
  • 32_BIT_SIGNED — A 32-bit signed data type supported by GRID. The values can range from – 2,147,483,648 to 2,147,483,647.
  • 32_BIT_FLOAT — A 32-bit data type supporting decimals.
  • 64_BIT — A 64-bit data type supporting decimals.

String
Data types for geoprocessing tool parameters


Command line example

CopyRaster_management d:\images\OverviewImage d:\images\Copy_OverviewImage # 0 # NONE NONE #

Scripting syntax
About getting started with writing geoprocessing scripts
CopyRaster_management (in_raster, out_rasterdataset, config_keyword, background_value, nodata_value, onebit_to_eightbit, colormap_to_RGB, pixel_type)

Parameter Explanation Data Type
in_raster (Required)

The name and location of the raster dataset to be copied.

Raster layer
out_rasterdataset (Required)

The name and location of the raster dataset to be created.

When storing a raster dataset in a geodatabase (personal, file, or ArcSDE), no file extension should be added to the name of the raster dataset. When storing the raster dataset in a file format, you need to specify the file extension: .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for TIFF, or no extension for GRID.

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.

Raster dataset | Raster catalog
config_keyword (Optional)

Specifies the storage parameters (configuration) for a file geodatabase and an ArcSDE geodatabase. Personal geodatabases do not use configuration keywords.

ArcSDE configuration keywords are set up by your database administrator.

String
background_value (Optional)

Use this option after rotating or projecting an image to remove the unwanted values created around the original raster data. The value specified will be distinguished from other valuable data in the raster dataset. For example, a value of zero along the raster dataset's borders will be distinguished from zero values within the raster dataset.

The pixel value specified will be set to NoData in the output raster dataset.

For file-based rasters and personal geodatabase rasters, the Ignore Background Value must be set to the same value as NoData in order for the background value to be ignored. File geodatabase rasters and SDE rasters will simply work without this extra step.

Double
nodata_value (Optional)

All the pixels with the specified value will be set to NoData in the output raster dataset.

Double
onebit_to_eightbit (Optional)

Choose whether the input 1-bit raster dataset will be converted to an 8-bit raster dataset. In this conversion, the value 1 in the input raster dataset will be changed to 255 in the output raster dataset. This is useful when importing a 1-bit raster dataset to ArcSDE. One-bit raster datasets have 8-bit pyramid layers when stored in a file system; but in ArcSDE, 1-bit raster datasets can only have 1-bit pyramid layers, which makes the display unpleasant. By converting the data to 8-bit in ArcSDE, the pyramid layers are built as 8-bit instead of 1-bit, resulting in a proper raster dataset in the display.

  • NONE — No conversion will be done. This is the default.
  • OneBitTo8Bit — The input raster will be converted.

Boolean
colormap_to_RGB (Optional)

If the input raster dataset has a color map, the output raster dataset can be converted to a three-band output raster dataset. This is useful when mosaicking rasters with different color maps.

  • NONE — No conversion will occur. This is the default.
  • ColormapToRGB — The input dataset will be converted.

Boolean
pixel_type (Optional)

Determines the bit depth of the output raster dataset. If left unspecified, the output bit depth will be the same as the input.

There will be no rescaling of the raster values when a different pixel type is chosen. If the pixel type is demoted (lowered), the raster values outside the valid range for that pixel depth will be truncated and lost.

  • 1_BIT — A 1-bit unsigned integer. The values can be 0 or 1.
  • 2_BIT — A 2-bit unsigned integer. The values supported can be from 0 to 3.
  • 4_BIT — A 4-bit unsigned integer. The values supported can be from 0 to 15.
  • 8_BIT_UNSIGNED — An unsigned 8-bit data type. The values supported can be from 0 to 255.
  • 8_BIT_SIGNED — A signed 8-bit data type. The values supported can be from – 128 to 127.
  • 16_BIT_UNSIGNED — A 16-bit unsigned data type. The values can range from 0 to 65,535.
  • 16_BIT_SIGNED — A 16-bit signed data type. The values can range from – 32,768 to 32,767.
  • 32_BIT_UNSIGNED — A 32-bit unsigned data type. The values can range from 0 to 4,294,967,295.
  • 32_BIT_SIGNED — A 32-bit signed data type supported by GRID. The values can range from – 2,147,483,648 to 2,147,483,647.
  • 32_BIT_FLOAT — A 32-bit data type supporting decimals.
  • 64_BIT — A 64-bit data type supporting decimals.

String

Data types for geoprocessing tool parameters


Script example

# CopyRaster_sample.py
# Description: Copy raster to another format 
# Requirements: None
# Author: ESRI
# Date: 1/28/04
# Create the geoprocessing object
import arcgisscripting
gp = arcgisscripting.create()

# Set input raster workspace
gp.workspace = "c:/rasterdata"
gp.toolbox="management"

# Copy Redlands.tif to output ArcSDE workspace with configuration keyword RASTER
gp.CopyRaster_management("redlands.tif","Database Connections/Connection to raster.sde/redlands","#","0","#","NONE","NONE","#")

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.