<?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: FocalSum with Boolean Syntax in Raster Calculator vs. Map Algebra in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/focalsum-with-boolean-syntax-in-raster-calculator/m-p/59463#M2092</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Here's what works in Raster Calculator: focalsum(Not(IsNull([IndicatorRaster])),RECTANGLE,7,7)&lt;BR /&gt;&lt;BR /&gt;In MapAlgebra, I get a 'Not is not a valid operator' error.&amp;nbsp; &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Clearly the parser doesn't like that, but here's a workaround: the rule for boolean is zero is false, anything else is true. In your case, IsNull converts NoData cells to 1, and other cells to 0. So the following map algebra is functionally equivalent:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;focalsum(IsNull([IndicatorRaster]) eq 0,RECTANGLE,7,7)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Nov 2010 20:43:39 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2010-11-10T20:43:39Z</dc:date>
    <item>
      <title>FocalSum with Boolean Syntax in Raster Calculator vs. Map Algebra</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/focalsum-with-boolean-syntax-in-raster-calculator/m-p/59462#M2091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to replicate a FocalSum process that works fine in Raster Calculator (9.3.1) but breaks when used in SingleOutputMapAlgebra_sa in Python. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's what works in Raster Calculator: focalsum(Not(IsNull([IndicatorRaster])),RECTANGLE,7,7)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In MapAlgebra, I get a 'Not is not a valid operator' error.&amp;nbsp; I've tried using '^' in place of 'Not' but that gives the same error.&amp;nbsp; I've played with spaces around the functions and inputs, which didn't help either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm stumped now... Any insights appreciated!&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lisa&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Nov 2010 17:16:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/focalsum-with-boolean-syntax-in-raster-calculator/m-p/59462#M2091</guid>
      <dc:creator>LisaNelson</dc:creator>
      <dc:date>2010-11-09T17:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: FocalSum with Boolean Syntax in Raster Calculator vs. Map Algebra</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/focalsum-with-boolean-syntax-in-raster-calculator/m-p/59463#M2092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Here's what works in Raster Calculator: focalsum(Not(IsNull([IndicatorRaster])),RECTANGLE,7,7)&lt;BR /&gt;&lt;BR /&gt;In MapAlgebra, I get a 'Not is not a valid operator' error.&amp;nbsp; &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Clearly the parser doesn't like that, but here's a workaround: the rule for boolean is zero is false, anything else is true. In your case, IsNull converts NoData cells to 1, and other cells to 0. So the following map algebra is functionally equivalent:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;focalsum(IsNull([IndicatorRaster]) eq 0,RECTANGLE,7,7)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Nov 2010 20:43:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/focalsum-with-boolean-syntax-in-raster-calculator/m-p/59463#M2092</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2010-11-10T20:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: FocalSum with Boolean Syntax in Raster Calculator vs. Map Algebra</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/focalsum-with-boolean-syntax-in-raster-calculator/m-p/59464#M2093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello - just saw your response (odd, since I checked it a few times the day or two after it was posted).&amp;nbsp; Thanks for your suggestiion - I'll try in on a new set of rasters I'm processing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Nov 2010 21:42:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/focalsum-with-boolean-syntax-in-raster-calculator/m-p/59464#M2093</guid>
      <dc:creator>LisaNelson</dc:creator>
      <dc:date>2010-11-19T21:42:33Z</dc:date>
    </item>
  </channel>
</rss>

