<?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: raster operations in python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/raster-operations-in-python/m-p/713688#M55353</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Read this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/de/arcgisdesktop/10.0/help/index.html#//000v0000012z000000" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/de/arcgisdesktop/10.0/help/index.html#//000v0000012z000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can adress the cells via array-indices with the numpy-array.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Mar 2012 06:24:59 GMT</pubDate>
    <dc:creator>FabianBlau</dc:creator>
    <dc:date>2012-03-26T06:24:59Z</dc:date>
    <item>
      <title>raster operations in python</title>
      <link>https://community.esri.com/t5/python-questions/raster-operations-in-python/m-p/713687#M55352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How can I sum two rasters and after reclassify the value field of the result according to the value of both input rasters ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can do the outPlus = Plus(inRaster1, inRaster2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;after I can do a loop for each row in outPlus&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rows = arcpy.SearchCursor(outPlus)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fields=arcpy.ListFields(outPlus) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for field in fields:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (...)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I grab the row value that are in inRaster1 and inRaster2 from inside the loop ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to do something like: if (inRaster=1 and inRaster2=8): new.row.value="area under development"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Mar 2012 11:56:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-operations-in-python/m-p/713687#M55352</guid>
      <dc:creator>RA1</dc:creator>
      <dc:date>2012-03-25T11:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: raster operations in python</title>
      <link>https://community.esri.com/t5/python-questions/raster-operations-in-python/m-p/713688#M55353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Read this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/de/arcgisdesktop/10.0/help/index.html#//000v0000012z000000" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/de/arcgisdesktop/10.0/help/index.html#//000v0000012z000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can adress the cells via array-indices with the numpy-array.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 06:24:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-operations-in-python/m-p/713688#M55353</guid>
      <dc:creator>FabianBlau</dc:creator>
      <dc:date>2012-03-26T06:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: raster operations in python</title>
      <link>https://community.esri.com/t5/python-questions/raster-operations-in-python/m-p/713689#M55354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; How do I grab the row value that are in inRaster1 and inRaster2 from inside the loop ?&lt;BR /&gt;I want to do something like: if (inRaster=1 and inRaster2=8): new.row.value="area under development"&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you meant cell by cell, this is easily done using map algebra, no need to resort to numpy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following code creates a new raster "new_area" for all cells where inRaster1 = 1 and inRaster2 = 8:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from arcpy.sa import *
inRaster1 = "e:\\work\\myraster1.tif"
inRaster2 = "e:\\work\\myraster2.tif"
outRaster = Con(inRaster1 == 1 and inRaster2 == 8,1)
outRaster.save("e:\\work\\new_area")
 &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:34:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-operations-in-python/m-p/713689#M55354</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T06:34:06Z</dc:date>
    </item>
  </channel>
</rss>

