I am trying to move raster files from one location to another.
By using the function: ListRasters (arcpy), I can get the list of rasters to be moved, but the problem is that even corrupted rasters are listed by this function. Actually if you use ArcCatalog and navigate to the folder, everything seems to be right and valid and invalid rasters are listed together but if you try to preview a corrupted one, it will pop-up:
In detail, I am talking here about several corrupted Esri GRID rasters. How to differentiate them?
So, when I use the function: Copy (Data Management), arcpy rises an error when trying to move an invalid GRID.
I was trying to solve this issue by using any of the properties of the Describe function: Describe object properties (arcpy), and getting any difference between the valid ones and the invalid ones, but this function raises an error on invalid datasets, so it cannot be used.
for raster in arcpy.ListRasters(): desc = arcpy.Describe(raster) Runtime error Traceback (most recent call last): File "<string>", line 4, in <module> File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\__init__.py", line 1200, in Describe return gp.describe(value) File "c:\program files\arcgis\desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 374, in describe self._gp.Describe(*gp_fixargs(args, True))) IOError: "raster" does not exist