<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Iterate Rasters in a Raster Catalog in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/iterate-rasters-in-a-raster-catalog/m-p/18939#M1460</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply Jake.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried your suggestion but there is no 'Classify' renderer for mosaic datasets.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I'm back to using a raster catalog - anyone been able to iterate through the raster datasets in a raster catalog using Python?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Sep 2012 08:09:06 GMT</pubDate>
    <dc:creator>AndrewCorcoran</dc:creator>
    <dc:date>2012-09-03T08:09:06Z</dc:date>
    <item>
      <title>Iterate Rasters in a Raster Catalog</title>
      <link>https://community.esri.com/t5/python-questions/iterate-rasters-in-a-raster-catalog/m-p/18937#M1458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do you get individual rasters from within a raster catalog in Python?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Get each raster in a raster catalog&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;See if they are single band integer&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;If they are then calculate the raster attribute table&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
import arcpy

arcpy.env.workspace = r"Database Connections\\RASTER.sde"

arcpy.MakeRasterCatalogLayer_management("catalogName", "temp")

rows = arcpy.SearchCursor("temp")
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; raster = arcpy.Raster(row.Raster)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It bombs out at the 'arcpy.Raster' creation with 'TypeError: expected a raster or layer name'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for any help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 08:33:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterate-rasters-in-a-raster-catalog/m-p/18937#M1458</guid>
      <dc:creator>AndrewCorcoran</dc:creator>
      <dc:date>2012-08-31T08:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate Rasters in a Raster Catalog</title>
      <link>https://community.esri.com/t5/python-questions/iterate-rasters-in-a-raster-catalog/m-p/18938#M1459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Andrew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would recommend using a &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//009t00000037000000"&gt;Mosaic Dataset&lt;/A&gt;&lt;SPAN&gt; rather than a raster catalog.&amp;nbsp; A Mosaic Dataset will save you an enormous amount of disk space, and it performs much faster.&amp;nbsp; Also, users will be able to change the symbology to Classified regardless if the source imagery has an attribute table or not.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2012 12:58:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterate-rasters-in-a-raster-catalog/m-p/18938#M1459</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-08-31T12:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate Rasters in a Raster Catalog</title>
      <link>https://community.esri.com/t5/python-questions/iterate-rasters-in-a-raster-catalog/m-p/18939#M1460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply Jake.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried your suggestion but there is no 'Classify' renderer for mosaic datasets.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I'm back to using a raster catalog - anyone been able to iterate through the raster datasets in a raster catalog using Python?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2012 08:09:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterate-rasters-in-a-raster-catalog/m-p/18939#M1460</guid>
      <dc:creator>AndrewCorcoran</dc:creator>
      <dc:date>2012-09-03T08:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate Rasters in a Raster Catalog</title>
      <link>https://community.esri.com/t5/python-questions/iterate-rasters-in-a-raster-catalog/m-p/18940#M1461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Andrew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Make sure you calculated statistics on your Mosaic Dataset.&amp;nbsp; You can do this by right-clicking on your Mosaic Dataset in the catalog window &amp;gt; Calculate Statistics.&amp;nbsp; You will then have the option to render the imagery with the 'Classified' option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]17454[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2012 09:41:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/iterate-rasters-in-a-raster-catalog/m-p/18940#M1461</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-09-04T09:41:03Z</dc:date>
    </item>
  </channel>
</rss>

