Skip to main content

ListRasterProducts

Summary

Returns a list of paths to the raster products associated with a metadata file.

Discussion

This function returns the list of paths to the raster products that are associated with a given metadata file path for any given supported sensor type such as Satellite or SAR.

Syntax

ListRasterProducts(metadata_file_path)

Parameter Explanation Data Type

metadata_file_path

The path to the metadata file.

String

Return value

Data Type Explanation

String

The list of paths to all the raster products for the metadata_file_path parameter value.

An empty list is returned if the data type is not supported, or when there are no raster products associated with the metadata file.

Code sample

ListRasterProducts example

List the raster products associated with Landsat 8 metadata file (*_MTL.txt).

import arcpy
arcpy.ListRasterProducts(r'c:\temp\LC80390382013135LGN01\LC80390382013135LGN01_MTL.txt')

# For example:
# ['c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\Multispectral',
# 'c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\QA',
# 'c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\Panchromatic',
# 'c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\Multiband',
# 'c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\Thermal',
# 'c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\Pansharpen',
# 'c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\Water',
# 'c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\Vegetation',
# 'c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\SnowIce',
# 'c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\Cirrus',
# 'c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\Cloud',
# 'c:\\temp\\LC80390382013135LGN01\\LC80390382013135LGN01_MTL.txt\\Landcover']