<?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: Calculating moving average on fishnet vector data  in Spatial Statistics Questions</title>
    <link>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468578#M1470</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/focal-statistics.htm"&gt;Focal Statistics&lt;/A&gt; tool will do this. &amp;nbsp;Maybe helpful?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Oct 2016 15:54:45 GMT</pubDate>
    <dc:creator>JenoraD_Acosta</dc:creator>
    <dc:date>2016-10-12T15:54:45Z</dc:date>
    <item>
      <title>Calculating moving average on fishnet vector data</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468576#M1468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have users interested in calculating a moving average on fishnet vector data (squares with statistical data). Each vector grid contains one or more columns with numerical values (population data). Converting to raster data is not an option at this time.&lt;/P&gt;&lt;P&gt;One user created an ArcView script "back in the days".&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/60499"&gt;Peter Gustafsson&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/113476"&gt;Daniel Nilsson&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 07:22:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468576#M1468</guid>
      <dc:creator>OscarMonell</dc:creator>
      <dc:date>2016-10-12T07:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating moving average on fishnet vector data</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468577#M1469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To do this I would create a python script that steps through the polygons, creates a temporary midpoint circle or buffer (or whatever shape you would like) with a desired radius. Then use this temporary shape to select the grid squares underneath (use a copy/clone as you already are stepping through the same dataset). Then summarize the desired attribute/attributes on that particular selection and store them either in a new dataset or preferably as new columns in the original grid dataset. Both sums and averages could be stored (the nominator area for the average can either come from the circular shape or be calculated as a sum of areas of the selected grids)&lt;/P&gt;&lt;P&gt;Then the script moves on to the next grid until all is stepped through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which selection type you use for selecting the grids must of course be desided  (either "completely inside" or just plain intersect).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The summarized values stored as the result for each grid must be thoroughly explained as they have really nothing to do with the original grid size except that the grid size, is the one used as the "moving steps" for the analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not a python programmer myself so I can't help you with any actual coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Daniel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Skickat från min Samsung-enhet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 11:43:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468577#M1469</guid>
      <dc:creator>DanielNilsson</dc:creator>
      <dc:date>2016-10-12T11:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating moving average on fishnet vector data</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468578#M1470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/focal-statistics.htm"&gt;Focal Statistics&lt;/A&gt; tool will do this. &amp;nbsp;Maybe helpful?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 15:54:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468578#M1470</guid>
      <dc:creator>JenoraD_Acosta</dc:creator>
      <dc:date>2016-10-12T15:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating moving average on fishnet vector data</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468579#M1471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,&amp;nbsp;&lt;/P&gt;&lt;P&gt;except that it only works with raster datasets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our use case is looking for the same toolsets but with vector based regular shapes (just like a raster, but as polygons).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2016 17:11:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468579#M1471</guid>
      <dc:creator>OscarMonell</dc:creator>
      <dc:date>2016-10-12T17:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating moving average on fishnet vector data</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468580#M1472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a Python translation of Daniel's recipe above. It works, technically, but is exceedingly slow because there is a selection for every fishnet cell. A better solution would involve reading the fishnet features into a data structure of some sort and operating on that, but that gets quite a bit more complicated.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'fishnet'&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# feature layer&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SHAPE@'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'MEAN'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# get each fishnet geometry and field to store mean&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# loop&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SelectLayerByLocation_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"WITHIN_A_DISTANCE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'100'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"NEW_SELECTION"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# make selection&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# initialize sum&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetCount_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getOutput&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# count number of selected features&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'POP'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor2&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# loop through selected features, reading population value&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row2 &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor2&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&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;&amp;nbsp;&amp;nbsp; sum &lt;SPAN class="operator token"&gt;+=&lt;/SPAN&gt; row2&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# add to current sum&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sum&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;count &lt;SPAN class="comment token"&gt;# calculate and store mean&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# write mean to feature layer&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:46:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468580#M1472</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T20:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating moving average on fishnet vector data</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468581#M1473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank's Darren!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will check with my Python staff if this is something to start with!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 12:17:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468581#M1473</guid>
      <dc:creator>OscarMonell</dc:creator>
      <dc:date>2016-10-13T12:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating moving average on fishnet vector data</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468582#M1474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any chance you still have access to ArcView 3.x?&amp;nbsp; If so, the option of doing it in &lt;EM&gt;Avenue&lt;/EM&gt; would be available.&amp;nbsp; Might be worth a try if you have the script already and don't need to modernize.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris Donohue, GISP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2016 15:34:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468582#M1474</guid>
      <dc:creator>ChrisDonohue__GISP</dc:creator>
      <dc:date>2016-10-13T15:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating moving average on fishnet vector data</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468583#M1475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is a regular grid, why do you have to use polygons? If it's a license issue, the Feature To Raster tool does not require a spatial analyst license, and neither does RasterToNumpyArray, so you can do this kind of thing fairly&amp;nbsp;easily with numpy arrays.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are stuck with it, Darren's approach will work faster if you turn off Arcmap drawing (if running from arcmap) with arcpy.env.AddOutputsToMap = False, and if you copy your polygon dataset into in_memory instead of on disk.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Oct 2016 03:40:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/calculating-moving-average-on-fishnet-vector-data/m-p/468583#M1475</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2016-10-29T03:40:15Z</dc:date>
    </item>
  </channel>
</rss>

