<?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: ArcGIS 10.2 - arcpy.ListRasters() returns nothing for a Raster Catalog in FGDB! in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388183#M30670</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "error" you posted isn't an error, e.g., "completed script" and "succeeded."&amp;nbsp; If there is an actual error message, it would be helpful to see.&amp;nbsp; Or, is it the results aren't what you expect?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Dec 2015 16:18:24 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2015-12-23T16:18:24Z</dc:date>
    <item>
      <title>ArcGIS 10.2 - arcpy.ListRasters() returns nothing for a Raster Catalog in FGDB!</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388175#M30662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a script, the rasters = arcpy.ListRasters() returns nothing for a Raster Catalog held in a File GDB? The workspace references to the Raster Catalog itself and I would expect to list the rasters in that Raster Catalog... But the list is empty!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rasters = arcpy.ListRasters("*", "All")
arcpy.AddMessage("Rasters: " + str(rasters))
i = 0
for raster in rasters:
&amp;nbsp;&amp;nbsp;&amp;nbsp; i = i + 1
arcpy.AddMessage("Count Rasters: " + str(i) + "\n")&lt;/PRE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;returns&lt;/P&gt;&lt;P&gt;Rasters: []&lt;/P&gt;&lt;P&gt;Count Rasters: 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anything wrong I am doing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:49:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388175#M30662</guid>
      <dc:creator>VincentLaunstorfer</dc:creator>
      <dc:date>2021-12-11T17:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10.2 - arcpy.ListRasters() returns nothing for a Raster Catalog in FGDB!</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388176#M30663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would treat a raster catalog as a table. To get a list of rasters in the catalog you would use a search cursor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rasCatalog = # path to raster catalog
rasterList = [row[0] for row in arcpy.da.SearchCursor(rasCatalog,["Name"])]&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:49:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388176#M30663</guid>
      <dc:creator>LukeSturtevant</dc:creator>
      <dc:date>2021-12-11T17:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10.2 - arcpy.ListRasters() returns nothing for a Raster Catalog in FGDB!</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388177#M30664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your syntax does work for listing the rasters in the Raster Catalog, but now I cannot go further:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for raster in rasters:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.gp.ExtractValuesToPoints(fc, raster, fc_tmp)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...because I would imagine that rasters contains only string and not Raster object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any guess?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:49:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388177#M30664</guid>
      <dc:creator>VincentLaunstorfer</dc:creator>
      <dc:date>2021-12-11T17:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10.2 - arcpy.ListRasters() returns nothing for a Raster Catalog in FGDB!</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388178#M30665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right working with raster catalogs are kind of a pain. Do do any operations with the rasters in the catalog you would need to export the raster then do the operation and if you do not want to keep the exported raster you would need to delete it afterwards. Something like this would work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rasCatalog = # path to raster
rasterList = [row[0] for row in arcpy.da.SearchCursor(rasCatalog,["Name"])]
fc = # path to feature layer

for raster in rasterList:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expression = &lt;SPAN style="color: #8f9d6a;"&gt;"Name = '{0}'"&lt;/SPAN&gt;.format(raster)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RasterCatalogToRasterDataset_management(rasCatalog&lt;SPAN style="color: #cc7832;"&gt;,PathForExportRaster&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;expression)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;arcpy.gp.ExtractValuesToPoints(fc,&lt;SPAN style="color: #cc7832; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;PathForExportRaster&lt;/SPAN&gt;, fc_tmp)&amp;nbsp; &lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:49:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388178#M30665</guid>
      <dc:creator>LukeSturtevant</dc:creator>
      <dc:date>2021-12-11T17:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10.2 - arcpy.ListRasters() returns nothing for a Raster Catalog in FGDB!</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388179#M30666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you set your workspace to a raster catalog, then &lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-functions/listdatasets.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ListDatasets &lt;/A&gt;will list the contents of the raster catalog.&amp;nbsp; It seems a bit goofy, but it works.&amp;nbsp; That said, I like to use the &lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/walk.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Walk &lt;/A&gt;function that is part of the Data Access module.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rasCatalog = # path to raster 
_, _, rasterList = next(arcpy.da.Walk(rasCatalog))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:49:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388179#M30666</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-11T17:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10.2 - arcpy.ListRasters() returns nothing for a Raster Catalog in FGDB!</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388180#M30667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ListDatasets function works very well to run through a RasterCatalog. It took 3h58min to extract elevation from 1320 tiled DEMs...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I would like to test the Walk function in order to see if the processing would be faster because the Data Access module is supposed to access data much faster according to ESRI documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, &lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;_, _, rasters = next(arcpy.da.Walk(rasCatalog))&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for raster in rasters:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.gp.ExtractValuesToPoints(fc, raster, fc_tmp)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did not work with workspace set a the Raster Catalog path...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I have to admit that I am not familiar with the Data Access module syntax!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:49:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388180#M30667</guid>
      <dc:creator>VincentLaunstorfer</dc:creator>
      <dc:date>2021-12-11T17:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10.2 - arcpy.ListRasters() returns nothing for a Raster Catalog in FGDB!</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388181#M30668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The time it takes for your script to run is being driven by geoprocessing, not finding/listing/enumerating your rasters.&amp;nbsp; You may shave a few minutes here or there, but I don't expect any real change in runtime based on ListDataSets or Walk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding using Walk, can you elaborate on "did not work?"&amp;nbsp; Did it generate an error?&amp;nbsp; If so, what error?&amp;nbsp; What backend storage is holding your raster catalog?&amp;nbsp; File geodatabase?&amp;nbsp; Enterprise geodatabase (SDE)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Dec 2015 18:52:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388181#M30668</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-12-21T18:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10.2 - arcpy.ListRasters() returns nothing for a Raster Catalog in FGDB!</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388182#M30669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Raster Catalog is in a File GDB v10.2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With a Mosaic Dataset, it takes just a few minutes to run the script versus a few hours with the Raster Catalog. However, I would prefer to use Raster Catalog because it can manage the rasters within the File GDB and compress the rasters smartly. The Mosaic Dataset just point to the rasters on disk...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error I receive is:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;function GetMessages at 0x1ACABF70&amp;gt;
Completed script RasterValuesToPointsCATALOG...
Succeeded at Tue Dec 22 11:44:46 2015 (Elapsed Time: 1.48 seconds)&lt;/PRE&gt;&lt;P&gt;when the script tries:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.gp.ExtractValuesToPoints(fc, raster, fc_tmp)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the reason why I suspect the rasters object genereted with the Walk functions not containing the proper raster...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:49:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388182#M30669</guid>
      <dc:creator>VincentLaunstorfer</dc:creator>
      <dc:date>2021-12-11T17:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10.2 - arcpy.ListRasters() returns nothing for a Raster Catalog in FGDB!</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388183#M30670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "error" you posted isn't an error, e.g., "completed script" and "succeeded."&amp;nbsp; If there is an actual error message, it would be helpful to see.&amp;nbsp; Or, is it the results aren't what you expect?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2015 16:18:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-10-2-arcpy-listrasters-returns-nothing-for/m-p/388183#M30670</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-12-23T16:18:24Z</dc:date>
    </item>
  </channel>
</rss>

