<?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 Splitting raster cells. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/splitting-raster-cells/m-p/511583#M40183</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a raster with a resolution of .47-meters, it contains one field that defines the presence or absence of forest canopy (1 or 0).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to use a 5-meter fishnet, (or 5-meter raster) to average the coverage within each each cell.&amp;nbsp;&amp;nbsp; The 5-meter raster obviously doesn't line up perfectly with the .47-meter raster.&amp;nbsp;&amp;nbsp; How do I get the exact percent coverage of the underlying forest canopy coverage into the 5-meter raster or fishnet.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doing a block statistic works, but when I run it with snap raster it changes the values to back to 1 or zero.&amp;nbsp;&amp;nbsp; I thought there might be a good solution using python.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I could also convert them to polygon features, but I'm surprised there isn't a good way to do it with 2 rasters. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for your help!:confused:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Mar 2013 02:40:48 GMT</pubDate>
    <dc:creator>TLeed</dc:creator>
    <dc:date>2013-03-04T02:40:48Z</dc:date>
    <item>
      <title>Splitting raster cells.</title>
      <link>https://community.esri.com/t5/python-questions/splitting-raster-cells/m-p/511583#M40183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a raster with a resolution of .47-meters, it contains one field that defines the presence or absence of forest canopy (1 or 0).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to use a 5-meter fishnet, (or 5-meter raster) to average the coverage within each each cell.&amp;nbsp;&amp;nbsp; The 5-meter raster obviously doesn't line up perfectly with the .47-meter raster.&amp;nbsp;&amp;nbsp; How do I get the exact percent coverage of the underlying forest canopy coverage into the 5-meter raster or fishnet.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Doing a block statistic works, but when I run it with snap raster it changes the values to back to 1 or zero.&amp;nbsp;&amp;nbsp; I thought there might be a good solution using python.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I could also convert them to polygon features, but I'm surprised there isn't a good way to do it with 2 rasters. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance for your help!:confused:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Mar 2013 02:40:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-raster-cells/m-p/511583#M40183</guid>
      <dc:creator>TLeed</dc:creator>
      <dc:date>2013-03-04T02:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting raster cells.</title>
      <link>https://community.esri.com/t5/python-questions/splitting-raster-cells/m-p/511584#M40184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you use focal statistics with 5m map units and then just con to your 5m raster?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Mar 2013 15:58:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-raster-cells/m-p/511584#M40184</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-03-04T15:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting raster cells.</title>
      <link>https://community.esri.com/t5/python-questions/splitting-raster-cells/m-p/511585#M40185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have a raster with a resolution of .47-meters, it contains one field that defines the presence or absence of forest canopy (1 or 0).&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;I need to use a 5-meter fishnet, (or 5-meter raster) to average the coverage within each each cell.&amp;nbsp;&amp;nbsp; The 5-meter raster obviously doesn't line up perfectly with the .47-meter raster.&amp;nbsp;&amp;nbsp; How do I get the exact percent coverage of the underlying forest canopy coverage into the 5-meter raster or fishnet.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The tool you are looking for is Aggregate. You can't get an "exact" aggregation - as .47 does not equally divide into 5 -- but it will be very close if you resample on the fly at a smaller cell size (.2) that equally divides into 5 meters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
from arcpy.sa import *
arcpy.env.cellSize = 0.2
# .2m * 25 = 5m (you could also use other values, say 0.1 and 50)
fiveMeterMean = Aggregate("p47rast",25,"MEAN")
# to get 0-100 percents:
fiveMeterPct = Aggregate("p47rast",5,"MEAN") * 100
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:23:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/splitting-raster-cells/m-p/511585#M40185</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T22:23:26Z</dc:date>
    </item>
  </channel>
</rss>

