Download Rasters (Data Management)

License Level:BasicStandardAdvanced

Summary

Allows you to download the source files of the selected rasters from an image service or mosaic dataset.

Usage

Syntax

DownloadRasters_management (in_image_service, out_folder, {where_clause}, {selection_feature}, {clipping}, {convert_rasters}, {format}, {compression_method}, {compression_quality}, {MAINTAIN_FOLDER})
ParameterExplanationData Type
in_image_service

The image service or mosaic dataset from which the selected rasters (footprints) will be downloaded.

Image Service; Mosaic Layer; Raster Layer; String
out_folder

The output folder to which the source files will be downloaded.

Folder
where_clause
(Optional)

Use SQL to define a query, or use the Query Builder to build a query that identifies the raster datasets to be downloaded.

SQL Expression
selection_feature
(Optional)

Specify the extent. You can specify the extent by specifying a feature as the minimum bounding rectangle, or by specifying the coordinates of the minimum bounding rectangle. Any rasters that intersect the extent will be downloaded.

Extent
clipping
(Optional)

Specify if you want to clip the downloaded images based on the geometry of a feature. Any raster that intersects the clipping geometry will be clipped and then downloaded. This is useful when your area of interest is not a rectangle. When downloaded images are clipped, you need to specify an output format for the clipped images.

  • NO_CLIPPINGThe files will be clipped based on the minimum bounding rectangle that has been specified. This is the default.
  • CLIPPINGThe files will be clipped based on the geometry of the selection_feature.
Boolean
convert_rasters
(Optional)

Choose whether to always convert your rasters to the specified format, or to only convert when it is necessary.

  • CONVERT_AS_REQUIREDYou will download the rasters in their source file format, unless conversion is required. This is the default.
  • ALWAYS_CONVERTYou will download the rasters with the format that you have specified.
Boolean
format
(Optional)

If a clipping extent was specified, then you need to choose the output format for the clipped rasters.

  • TIFFTagged Image File Format. This is the default.
  • BILESRI band interleaved by line.
  • BSQESRI band sequential.
  • BIPESRI band interleaved by pixel.
  • BMPBitmap.
  • ENVIENVI DAT file.
  • IMAGINE ImageERDAS IMAGINE.
  • JPEGJoint Photographics Experts Group. If chosen, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100.
  • GIFGraphic interchange format.
  • JP2JPEG 2000. If chosen, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100.
  • PNGPortable Network Graphics.
String
compression_method
(Optional)

Choose the compression method to use with the specified Output Format.

  • NONENo compression will occur. This is the default.
  • JPEGLossy compression that uses the public JPEG compression algorithm. If you choose JPEG, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100. This compression can be used for JPEG files and TIFF files.
  • LZWLossless compression that preserves all raster cell values.
  • PACKBITSPackBits compression for TIFF files.
  • RLERun-length encoding for IMG files.
  • CCITT_GROUP3Lossless compression for 1-bit data.
  • CCITT_GROUP4Lossless compression for 1-bit data.
  • CCITT_1DLossless compression for 1-bit data.
String
compression_quality
(Optional)

Specify the compression quality when JPEG or JP2 compression is chosen. Valid values range from 1 to 100, where a higher number means better image quality but less compression.

Long
MAINTAIN_FOLDER
(Optional)

Choose whether to have a flat folder structure or to maintain the hierarchical folder structure used to store the source raster datasets.

  • NO_MAINTAIN_FOLDERAll the files will be downloaded into the out_folder as a flat folder structure. This is the default.
  • MAINTAIN_FOLDERThe files will be downloaded to the out_folder in the same hierarchical structure as the source data.
Boolean

Code Sample

DownloadRasters example 1 (Python window)

This is a Python sample for the DownloadRasters tool.

import arcpy
DownloadRasters_management(
     "http://srv/arcgis/services/Ext/MDpan/ImageServer?", "c:/dload/", 
     "AcquisitionDate = date '1999-08-18'", "", 
     "c:/workspace/clippingfeat.shp", "TIFF", "JPEG", "75", 
     "MAINTAIN_FOLDER", "CONVERT_AS_REQUIRED")
DownloadRasters example 2 (stand-alone script)

This is a Python script sample for the DownloadRasters tool.

##Download Rasters from image services URL
##Maintain the original sensor data folder structure

import arcpy
arcpy.env.workspace = r"\\myworkstation\Workspace\downloadras"
    
arcpy.DownloadRasters_management(
     "http://serv1/arcgis/services/Ext/MD_LS_pan/ImageServer?",
     "downloadFolder", "AcquisitionDate = date '1999-08-18 00:00:00'",
     "", "", "", "", "", "MAINTAIN_FOLDER")

Environments

Resampling Method

Only when clipping occurs.

NoData

Only when clipping occurs.

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013