Download Rasters (Data Management)

Summary

Downloads the source files from an image service or mosaic dataset.

Usage

  • The raster datasets you download are the source files, unless you convert them to another format. Format conversion can be forced, or will only occur when required. Downloaded files are converted if clipping occurs or the source file cannot be downloaded as a raster.

  • You can download selected rasters or LAS files from an image service or a mosaic dataset to a specified folder in the original file format.

  • If a clipping extent is specified, the rasters that intersect the clip extent will be clipped and then converted to a specified format.

  • You can choose to download the data in the same folder structure as the source.

Parameters

LabelExplanationData Type
Input

The image service or mosaic dataset to download.

Image Service; Mosaic Layer; Raster Layer; String
Output Folder

The destination for the image service or mosaic dataset.

Folder
Query Definition
(Optional)

An SQL expression to limit the download to raster datasets that satisfy the expression.

SQL Expression
Selection Feature
(Optional)

Limits the download to an extent of a feature class or bounding box. All raster datasets that intersect the extent will be downloaded.

  • Current Display Extent Map View—The extent will be based on the active map or scene. This option is only available when there is an active map.
  • Draw Extent Square and Finish—The extent will be based on a rectangle drawn on the map or scene. This option will create a feature class in the project geodatabase and add a layer to the map. The feature class will have the same coordinate system as the map.
    Note:

    This option is not available in the Environments dialog box. It is only available from a tool parameter with an extent data type or from the Environments tab on a tool dialog box.

    Note:

    When the Enable and disable editing from the Edit tab editing option is checked, you must enable editing on the Edit ribbon tab to draw the extent.

  • Extent of a Layer Layer—The extent will be based on an active map layer. Use the drop-down list to choose an available layer or use the Extent of data in all layers option to get the combined extent of all active map layers, excluding the basemap. This option is only available when there is an active map with layers.

    Each map layer has the following options:

    • All Features Select All—The extent of all features in the layer.
    • Selected Features Area from Selected Features—The extent of the selected features in the layer.
    • Visible Features Extent Indicator—The extent of the visible features in the layer.
      Note:

      The extents from the Selected Features Area from Selected Features and Visible Features Extent Indicator options are only available for feature layers.

  • Browse Browse—The extent will be based on an existing dataset.
  • Clipboard Paste—The extent can be copied to and pasted from the clipboard.
    • Copy Extent Copy—Copies the extent coordinates and coordinate system to the clipboard.
    • Use Paste Extent Paste—Pastes the extent coordinates and, optionally, the coordinate system from the clipboard. If the clipboard values do not include a coordinate system, the extent will use the map’s coordinate system.
    Note:

    The extent coordinates are copied to and pasted from the clipboard using the same formatting and order as the ArcPy Extent object: x-min, y-min, x-max, y-max, and the spatial reference.

  • Reset Extent Reset—The extent will be reset to the default value.
  • Manually entered coordinates—The coordinates must be numeric values and in the active map's coordinate system.
    Caution:

    The map may use different display units than the entered coordinates. The use of a cardinal direction (N, S, E, W) is not supported. Use a negative value sign for south and west coordinates.

Extent
Clipping Using Selection Feature
(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.

  • Unchecked—The files will be clipped based on the minimum bounding rectangle that has been specified. This is the default.
  • Checked—The 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.

  • Unchecked—Do not convert the raster datasets to a new format.
  • Checked—Convert the downloaded raster datasets into another format. If you used Selection Feature to limit the extent, then you need to specify a format in the Output Format parameter.
Boolean
Output Format
(Optional)

Choose a output format for the downloaded raster datasets.

  • 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)

Set a value from 1 - 100. Higher values will have better image quality, but less compression.

Long
Maintain Folder Structure
(Optional)

Determines the folder structure of the downloaded rasters.

  • Checked—replicates the hierarchical folder structure used to store the source raster datasets.
  • Unchecked—raster datasets will be downloaded into the output folder as a flat folder structure

Boolean

Derived Output

LabelExplanationData Type
Updated Folder

The updated output folder.

Folder

arcpy.management.DownloadRasters(in_image_service, out_folder, {where_clause}, {selection_feature}, {clipping}, {convert_rasters}, {format}, {compression_method}, {compression_quality}, {MAINTAIN_FOLDER})
NameExplanationData Type
in_image_service

The image service or mosaic dataset to download.

Image Service; Mosaic Layer; Raster Layer; String
out_folder

The destination for the image service or mosaic dataset.

Folder
where_clause
(Optional)

An SQL expression to limit the download to raster datasets that satisfy the expression.

SQL Expression
selection_feature
(Optional)

Limits the download to an extent of a feature class or bounding box. All raster datasets that intersect the extent will be downloaded.

  • MAXOF—The maximum extent of all inputs will be used.
  • MINOF—The minimum area common to all inputs will be used.
  • DISPLAY—The extent is equal to the visible display.
  • Layer name—The extent of the specified layer will be used.
  • Extent object—The extent of the specified object will be used.
  • Space delimited string of coordinates—The extent of the specified string will be used. Coordinates are expressed in the order of x-min, y-min, x-max, y-max.
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_REQUIREDDo not convert the raster datasets to a new format.
  • ALWAYS_CONVERTConvert the downloaded raster datasets into another format. If you used selection_feature to limit the extent, then you need to specify a format in the format parameter.
Boolean
format
(Optional)

Choose a output format for the downloaded raster datasets.

  • 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)

Set a value from 1 - 100. Higher values will have better image quality, but less compression.

Long
MAINTAIN_FOLDER
(Optional)

Determines the folder structure of the downloaded rasters.

  • MAINTAIN_FOLDERReplicate the hierarchical folder structure used to store the source raster datasets.
  • NO_MAINTAIN_FOLDERRaster datasets will be downloaded into the out_folder as a flat folder structure.
Boolean

Derived Output

NameExplanationData Type
derived_out_folder

The updated output folder.

Folder

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

Related topics