<?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: CalculateStatistics on Mosaic Dataset in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculatestatistics-on-mosaic-dataset/m-p/545799#M42572</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think I have narrowed down the problem to the Area of Interest parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; In my script, I dynamically create a polygon feature class that is the same extent of the footprint/boundary of the mosaic.&amp;nbsp; This FC does reside in the same FGDB as the mosaic, but is its own feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.&amp;nbsp; Running Calculate Statistics toolbox script (which successfully adds classified symbology property) auto-populates the Area of Interest parameter with: CalculateStatistics::area_of_interest and adds an empty polygon fc to the Table of Contents.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, there is something going on there with the tool adding CalculateStatistics::area_of_interest that I am not understanding.&amp;nbsp; Any additional input is appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;j&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Jan 2014 13:50:21 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2014-01-03T13:50:21Z</dc:date>
    <item>
      <title>CalculateStatistics on Mosaic Dataset</title>
      <link>https://community.esri.com/t5/python-questions/calculatestatistics-on-mosaic-dataset/m-p/545795#M42568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am attempting to calculate statistics on mosaic datasets in a FGDB.&amp;nbsp; It appears to work correctly however it runs and I add the mosaic to the TOC and access the symbology properties of the Mosaic dataset, it does not allow for Classified type (only Stretched and Discrete color are available).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am expecting to be able to apply a classified renderer on the mosaic, which it works as expected if I manually run the Calculate Statistics from the "Enhance" menu (by right clicking on the mosaic in the catalog tree and accessing this menu option there).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any reason why I can access the classified symbol property after running calculate stat from the Enhance menu, but not from the code below?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;j&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

def calcStatsMOSAIC(t):

&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = ws_output

&amp;nbsp;&amp;nbsp;&amp;nbsp; bndy_mosaic = str(ws_output) + "\\rasext" + str(t)
&amp;nbsp;&amp;nbsp;&amp;nbsp; mosaic_name = "ConcMosaic" + str(t)
&amp;nbsp;&amp;nbsp;&amp;nbsp; ws_mosaic = str(ws_output) + "\\" + str(mosaic_name)
&amp;nbsp;&amp;nbsp;&amp;nbsp; tr = "*Mosaic*"
&amp;nbsp;&amp;nbsp;&amp;nbsp; rasters = arcpy.ListDatasets(tr) 
&amp;nbsp;&amp;nbsp;&amp;nbsp; for r in rasters:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ##CALC STATISTICS
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateStatistics_management(ws_mosaic, 1, 1, "#", "OVERWRITE", bndy_mosaic)

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 12:28:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatestatistics-on-mosaic-dataset/m-p/545795#M42568</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2013-12-16T12:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateStatistics on Mosaic Dataset</title>
      <link>https://community.esri.com/t5/python-questions/calculatestatistics-on-mosaic-dataset/m-p/545796#M42569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;bump to the top&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 14:05:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatestatistics-on-mosaic-dataset/m-p/545796#M42569</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2014-01-02T14:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateStatistics on Mosaic Dataset</title>
      <link>https://community.esri.com/t5/python-questions/calculatestatistics-on-mosaic-dataset/m-p/545797#M42570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've noticed after a mosaic dataset is created and statistics are calculated using a script, they will not show until you restart ArcMap.&amp;nbsp; You may want to follow up with Tech Support on this.&amp;nbsp; Also, you can simplify your script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def calcStatsMOSAIC(t):
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = ws_output
&amp;nbsp;&amp;nbsp;&amp;nbsp; mosaic_name = "ConcMosaic" + str(t)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateStatistics_management(mosaic_name, 1, 1)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; Create your mosaic dataset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2.&amp;nbsp; Run the script&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3.&amp;nbsp; Restart ArcMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4.&amp;nbsp; Add the mosaic dataset to ArcMap and see if you 'Classified' for a symbology type&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:36:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatestatistics-on-mosaic-dataset/m-p/545797#M42570</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T23:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateStatistics on Mosaic Dataset</title>
      <link>https://community.esri.com/t5/python-questions/calculatestatistics-on-mosaic-dataset/m-p/545798#M42571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi James,&lt;BR /&gt;&lt;BR /&gt;I've noticed after a mosaic dataset is created and statistics are calculated using a script, they will not show until you restart ArcMap.&amp;nbsp; You may want to follow up with Tech Support on this.&amp;nbsp; Also, you can simplify your script:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def calcStatsMOSAIC(t):
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = ws_output
&amp;nbsp;&amp;nbsp;&amp;nbsp; mosaic_name = "ConcMosaic" + str(t)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateStatistics_management(mosaic_name, 1, 1)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Try the following:&lt;BR /&gt;&lt;BR /&gt;1.&amp;nbsp; Create your mosaic dataset&lt;BR /&gt;2.&amp;nbsp; Run the script&lt;BR /&gt;3.&amp;nbsp; Restart ArcMap&lt;BR /&gt;4.&amp;nbsp; Add the mosaic dataset to ArcMap and see if you 'Classified' for a symbology type&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your input, Jake,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I ran the script/.py from PythonWin and from a Toolbox Script, both have the same result even after restarting ArcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, I appreciate the simplification suggestion.&amp;nbsp; I need to iterate over raster datasets as shown because there are both mosaic's and individual rasters, which I just need to acquire the mosaic to calc the statistics.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:37:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatestatistics-on-mosaic-dataset/m-p/545798#M42571</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T23:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateStatistics on Mosaic Dataset</title>
      <link>https://community.esri.com/t5/python-questions/calculatestatistics-on-mosaic-dataset/m-p/545799#M42572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think I have narrowed down the problem to the Area of Interest parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; In my script, I dynamically create a polygon feature class that is the same extent of the footprint/boundary of the mosaic.&amp;nbsp; This FC does reside in the same FGDB as the mosaic, but is its own feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.&amp;nbsp; Running Calculate Statistics toolbox script (which successfully adds classified symbology property) auto-populates the Area of Interest parameter with: CalculateStatistics::area_of_interest and adds an empty polygon fc to the Table of Contents.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, there is something going on there with the tool adding CalculateStatistics::area_of_interest that I am not understanding.&amp;nbsp; Any additional input is appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;j&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 13:50:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatestatistics-on-mosaic-dataset/m-p/545799#M42572</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2014-01-03T13:50:21Z</dc:date>
    </item>
  </channel>
</rss>

