<?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 Python script to derive new cells values from the current ones, in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-to-derive-new-cells-values-from-the/m-p/286727#M22172</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Python script to derive new cells values from the current ones,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I couldn???t figure out how to develop a code that change the values of cells based on If ???Then statements.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Suppose that I got a raster where its cells have seven possible values:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. water, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. road, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. commercial, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. forest area, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. residential areas, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;6. pasture and &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;7. row crops&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and I wanted to derive a new values for the current cells based on the rules below (Sharaf Alkheder and Jie Shan) considering 3x3 window:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. IF tested pixel under consideration is water, THEN no growth is allowed at this pixel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. IF tested pixel under consideration is road, THEN no growth is allowed at this pixel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. IF tested pixel under consideration is residential OR commercial, THEN keep this pixel&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the same without any change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. IF tested pixel under consideration is either (forest OR pasture OR row crops) AND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;there are 4 commercial pixels in the neighborhood, THEN change tested pixel to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;commercial.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. IF tested pixel under consideration is either (forest OR pasture OR row crops) AND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;there are 4 HEN change tested pixel to residential.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then how such code can be developed? any hints?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, the built-in tools in the ArcGIS don't do this sort of work (such as focal statistics).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]23087[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&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;Jamal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 30 Mar 2013 07:17:43 GMT</pubDate>
    <dc:creator>JamalNUMAN</dc:creator>
    <dc:date>2013-03-30T07:17:43Z</dc:date>
    <item>
      <title>Python script to derive new cells values from the current ones,</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-derive-new-cells-values-from-the/m-p/286727#M22172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Python script to derive new cells values from the current ones,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I couldn???t figure out how to develop a code that change the values of cells based on If ???Then statements.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Suppose that I got a raster where its cells have seven possible values:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. water, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. road, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. commercial, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. forest area, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. residential areas, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;6. pasture and &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;7. row crops&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and I wanted to derive a new values for the current cells based on the rules below (Sharaf Alkheder and Jie Shan) considering 3x3 window:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. IF tested pixel under consideration is water, THEN no growth is allowed at this pixel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. IF tested pixel under consideration is road, THEN no growth is allowed at this pixel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. IF tested pixel under consideration is residential OR commercial, THEN keep this pixel&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the same without any change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. IF tested pixel under consideration is either (forest OR pasture OR row crops) AND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;there are 4 commercial pixels in the neighborhood, THEN change tested pixel to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;commercial.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5. IF tested pixel under consideration is either (forest OR pasture OR row crops) AND&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;there are 4 HEN change tested pixel to residential.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then how such code can be developed? any hints?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, the built-in tools in the ArcGIS don't do this sort of work (such as focal statistics).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]23087[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&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;Jamal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Mar 2013 07:17:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-derive-new-cells-values-from-the/m-p/286727#M22172</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2013-03-30T07:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to derive new cells values from the current ones,</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-derive-new-cells-values-from-the/m-p/286728#M22173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See the spatial anlysts Con method, it allows you to create what-if scenarios&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Mar 2013 07:59:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-derive-new-cells-values-from-the/m-p/286728#M22173</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2013-03-30T07:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to derive new cells values from the current ones,</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-derive-new-cells-values-from-the/m-p/286729#M22174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;See the spatial anlysts Con method, it allows you to create what-if scenarios&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks Dan for the answer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sound that the Con (spatial analyst) is not appropriate to do the job!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, how to construct a code for the condition below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IF tested pixel under consideration is either (forest OR pasture OR row crops) AND there are 4 commercial pixels in the neighborhood THEN change tested pixel to commercial (applying 3x3 window)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]23099[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is that possible using the Con (spatial analyst) tool?&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;Jamal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Mar 2013 19:16:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-derive-new-cells-values-from-the/m-p/286729#M22174</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2013-03-30T19:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to derive new cells values from the current ones,</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-derive-new-cells-values-from-the/m-p/286730#M22175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Many thanks Dan for the answer,&lt;BR /&gt;&lt;BR /&gt;Sound that the Con (spatial analyst) is not appropriate to do the job!&lt;BR /&gt;&lt;BR /&gt;For example, how to construct a code for the condition below:&lt;BR /&gt;&lt;BR /&gt;IF tested pixel under consideration is either (forest OR pasture OR row crops) AND there are 4 commercial pixels in the neighborhood THEN change tested pixel to commercial (applying 3x3 window)&lt;BR /&gt;&lt;BR /&gt;[ATTACH=CONFIG]23099[/ATTACH]&lt;BR /&gt;&lt;BR /&gt;Is that possible using the Con (spatial analyst) tool?&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;&lt;BR /&gt;Jamal&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The data is attached&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Sep 2013 13:17:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-derive-new-cells-values-from-the/m-p/286730#M22175</guid>
      <dc:creator>JamalNUMAN</dc:creator>
      <dc:date>2013-09-14T13:17:14Z</dc:date>
    </item>
  </channel>
</rss>

