Show Navigation | Hide Navigation
You are here:
Geoprocessing > Automating your work with scripts > Scripting object: Properties and Methods > Properties and Methods

ListRasters method

Release 9.3
Last modified January 19, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Properties and Methods"


Related Topics

Note: This topic was updated for 9.3.1.

Lists all rasters from the selected workspace. Specifying search conditions (wildcard) and a feature type limits the results. The workspace must be specified before using any of the List methods except ListFields and ListIndexes.

Returns a Python List that will contain names of the rasters under the location specified by the workspace environment.

NOTE: The content below describes the use of ListRasters using a 9.3-version geoprocessor. When using a 9.2-version geoprocessor, ListRasters returns an enumeration instead of a Python List. For more information, see Differences between geoprocessor versions.



Syntax


object.ListRasters({wildCard} As String, {RasterType} As String) as Python List

{} = optional

Part Description
object The instantiated geoprocessing object.
wildCard Optional. Combination of * and characters that helps to limit the results. The asterisk is the same as saying ALL. If no wildcard is specified, all rasters in the workspace will be returned.
RasterType Specifies the raster format.

  • BMP—Bitmap graphic raster dataset format.
  • GIF—Graphic Interchange Format for raster datasets.
  • IMG—ERDAS IMAGINE raster data format.
  • JP2—JPEG 2000 raster dataset format.
  • JPG—Joint Photographics Experts Group raster dataset format.
  • PNG—Portable Network Graphics raster dataset format.
  • TIFF—Tagged image file Format for raster datasets.
  • GRID—ESRI Grid data format.
  • ALL—All rasters. This is the default.


Examples


import arcgisscripting
gp = arcgisscripting.create(9.3)

gp.workspace = "c:/DEMs"

# Get a list of grids in the workspace.
#
rasters = gp.ListRasters("", "GRID")

for raster in rasters:
    print raster



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