How do you get individual rasters from within a raster catalog in Python?I'm trying to:- Get each raster in a raster catalog
- See if they are single band integer
- If they are then calculate the raster attribute table
The raster catalog is stored in a SQL Server database and I need to automate building of raster attribute tables so that all users can then use the 'Classify' raster dataset renderer in ArcMap. They can't use this at the moment as they do not have 'CREATE TABLE' permissions in SQL Server and I really don't want to give them that permission.So far I have:
import arcpy
arcpy.env.workspace = r"Database Connections\\RASTER.sde"
arcpy.MakeRasterCatalogLayer_management("catalogName", "temp")
rows = arcpy.SearchCursor("temp")
for row in rows:
raster = arcpy.Raster(row.Raster)
It bombs out at the 'arcpy.Raster' creation with 'TypeError: expected a raster or layer name'Thanks in advance for any help.