<?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: Zonal stats: fail to open raster dataset for a multi-band tiff. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16801#M1298</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tab1_1 = ZonalStatisticsAsTable(AOI, "OBJECTID", Img1_1, tab_1_1, "", "MINIMUM")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;instead of&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tab1_1 = ZonalStatisticsAsTable(AOI, "OBJECTID", Img1_1, "tab_1_1", "", "MINIMUM")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Dec 2011 15:21:26 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2011-12-06T15:21:26Z</dc:date>
    <item>
      <title>Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16800#M1297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Trying to extract some values from some tiny AOI polygons from multiple bands of a .tif.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;AOI = "X:\\aoi.shp"
Img1_1 = "X:\\Glovertown_in_1.tif\\Band_1"
tab_1_1 = "X:\\Tab1_1"

Tab1_1 = ZonalStatisticsAsTable(AOI, "OBJECTID", Img1_1, "tab_1_1", "", "MINIMUM")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: ERROR 999999: Error executing function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to open raster dataset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (ZonalStatisticsAsTable).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone tell me what's going wrong here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rich&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 14:45:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16800#M1297</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2011-12-06T14:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16801#M1298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tab1_1 = ZonalStatisticsAsTable(AOI, "OBJECTID", Img1_1, tab_1_1, "", "MINIMUM")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;instead of&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tab1_1 = ZonalStatisticsAsTable(AOI, "OBJECTID", Img1_1, "tab_1_1", "", "MINIMUM")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 15:21:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16801#M1298</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-12-06T15:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16802#M1299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried that as well, right after I posted. No Dice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The tools says it supports floating rasters for the minimum statistic. Hoping not to have to create a bunch of extra output just to convert to int, which is my current hunch.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rich&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 15:26:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16802#M1299</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2011-12-06T15:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16803#M1300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What if you convert band1 of your .tif to a grid... Does it work then? Maybe ZonalStats doesn't like using multiband .tif files as input?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 15:28:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16803#M1300</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-12-06T15:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16804#M1301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That is possible but this is a small piece of code for a larger project. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. If I have to convert everything to grid, it's probably a deal breaker. I'll just work it out in SML in ERDAS. I'm trying to use python because it would allow me to automate a bit further down the line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. I've seen other people (code examples in these forums) work successfully with .tif&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 16:20:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16804#M1301</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2011-12-06T16:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16805#M1302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I ran a little test, and I was able to use Band_1 from a multiband .tif in the Zonal Statistics as Table tool via ArcToolbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.ZonalStatisticsAsTable(roadshedFC, "ROADSHED_ID", r"C:\temp\test.tif\Band_1", outZnStatsTbl, "", "ALL")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe it's just the map algebra is wonkey...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does the toolbox tool work for you?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 16:35:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16805#M1302</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-12-06T16:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16806#M1303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your persistence Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, of course (sarcasm) the tool runs fine. Unfortunately, this isn't going to be very useful in the grand scheme. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the tool, python snipet:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.ZonalStatisticsAsTable_sa("X:/aoi.shp","OBJECTID","X:/image_in_1.tif/Band_1","x:/zonalst_glovert1","DATA","MINIMUM")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But we have made progress. What's wrong with this code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 17:13:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16806#M1303</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2011-12-06T17:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16807#M1304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try using a different field than OBJECTID from your AOI polygon. Used to be that OBJECTID wasn't an allowed field for any SA tools. Now it seems to be okay, but sometimes the ESRI tools revert to past behaviors...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What if you use the "ALL" default for the statistic type? Better yet, just use "" to force the default value.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 19:22:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16807#M1304</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-12-06T19:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16808#M1305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris, no dice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Trying default values as you suggested. Created an IMG, didn't work. Brought the IMG into a GDB, didn't work. All the same error "failure to open raster dataset". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where is Python disconnected from the tool? I had a similar problem with Mosaic a while back, where python wouldn't run, but the tool does. I ended up having to do something completely different just to work around.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone have any foundational wisdom here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chris probably needs some relief! I know I do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Dec 2011 21:11:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16808#M1305</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2011-12-06T21:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16809#M1306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've had trouble with ZonalStats using objectid fields previously. Try using another field of SmallInteger or Integer type, no floating points (i.e. Double) or text.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You also need to make sure that the ArcGIS ScratchWorkspace environment setting (or the Windows %TEMP% environment variable) points to a path without spaces as ArcGIS writes temporary grids there and will fail with a very unhelpful error message if the path has spaces.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 23:26:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16809#M1306</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2011-12-07T23:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16810#M1307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Luke,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks. I did create an ID field that did not work. I also passed the image layers to Int() prior to opening. I've tried on multiple images in the area, using .tif and .img file types and different bands. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll have to check my scratch workspace tomorrow. Thanks. Not sure why that would work in a model and not python though. Maybe I'll post a new thread with that difference in the title.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 01:56:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16810#M1307</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2011-12-08T01:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16811#M1308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Richard, did you ever find what the problem was?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having similar trouble trying to composite bands.&amp;nbsp; I've tried using them as tiffs and as grids, but I get error 000271: Cannot open the input datasets.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kat&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 14:30:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16811#M1308</guid>
      <dc:creator>KatSuda</dc:creator>
      <dc:date>2012-12-08T14:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16812#M1309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Kat,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Honestly, I don't remember if this was ever resolved. I'm thinking it was not, as I use tab areas to calculate my own stats usually (although zonal stats in 10.1 is superior because to calculates partial pixel values). I'd suggest you start a new thread and post your version info and code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This community is pretty great at either giving an answer quickly, or, if they can't, you will know quickly that you have to work around.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rich&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 15:03:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16812#M1309</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2012-12-08T15:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16813#M1310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, Rich.&amp;nbsp; I'll post the question.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Dec 2012 15:25:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16813#M1310</guid>
      <dc:creator>KatSuda</dc:creator>
      <dc:date>2012-12-08T15:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Zonal stats: fail to open raster dataset for a multi-band tiff.</title>
      <link>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16814#M1311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Just don't change the ArcGIS default output location when running the tool. You can change the name of the output file though. But let it save in the default directory given by ArcGIS (somewhere in User-Documents-ArcGIS-...). Works for me with this trick.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 13:41:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/zonal-stats-fail-to-open-raster-dataset-for-a/m-p/16814#M1311</guid>
      <dc:creator>SalmanAhmed3</dc:creator>
      <dc:date>2016-05-23T13:41:50Z</dc:date>
    </item>
  </channel>
</rss>

