2

I have 2 rasters in my workspace, one in TIFF Format and the other in GRID format: "C:\ExampleFolder"

When I use the python script:

import arcpy
>>> rasl=arcpy.ListRasters("C:\ExampleFolder")
>>> print rasl
None

Python does not recognize my raster files. I'm attempting to use the script in this previous question:

Clip raster using shapefile into multiple rasters using ArcGIS Desktop?

I keep receiving error: ERROR 000732: Input Rasters: Dataset does not exist or is not supported.

Any reason why Python does not recognize my raster?

asked Feb 4, 2014 at 16:15

1 Answer 1

8

Try explicitly defining the workspace:

import arcpy
arcpy.env.workspace = r'C:\path\to\your\ws'
rasl = arcpy.ListRasters()

The documentation shows that you cannot include the path of your workspace in the ListRaster function:

The workspace environment must be set first before using several of the List functions, including ListDatasets, ListFeatureClasses, ListFiles, ListRasters, ListTables, and ListWorkspaces.

arcpy.ListRasters ({wild_card}, {raster_type})
answered Feb 4, 2014 at 16:33
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.