<?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: Beta 10: &amp;quot;built-in&amp;quot; rasters in python map algebra in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479722#M6910</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Has there been any movement on this in terms of including a script or built-in tool in Arc 10?&amp;nbsp; If not, can you tell me is the script above intended to be run in the raster calculator or as a script in a model or toolbox?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Dec 2011 14:06:12 GMT</pubDate>
    <dc:creator>MarkCarroll</dc:creator>
    <dc:date>2011-12-27T14:06:12Z</dc:date>
    <item>
      <title>"Built-in" rasters in python map algebra</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479713#M6901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Any progress in implementing something like Map Algebra's &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$$ROWMAP: Row address of the processing cell&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$$COLMAP: Column address of the processing cell&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$$XMAP: x-map coordinate for the center of the processing cell&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$$YMAP: y-map coordinate for the center of the processing cell&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2009 22:31:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479713#M6901</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2009-12-22T22:31:19Z</dc:date>
    </item>
    <item>
      <title>"built-in" rasters in python map algebra</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479714#M6902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Curtis,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This functionality will not be provided at&amp;nbsp; Beta 2 using Map Algebra in the Python Window.&amp;nbsp; You can however, script it just as you did in versions prior to 9.4.&amp;nbsp; All pre-9.4 scripts/models will still execute just fine.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2009 16:42:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479714#M6902</guid>
      <dc:creator>EricRice</dc:creator>
      <dc:date>2009-12-23T16:42:48Z</dc:date>
    </item>
    <item>
      <title>$$ROWMAP etc</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479715#M6903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had a nice discussion with a product team member (who shall remain anonymous) about this a couple of weeks ago.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;He suggested getting conversant with the numpy raster object -- arcpy will have hooks to easily go back and forth, which may be a really handy way to create function-based rasters that don't lend themselves easily to map algebra, or are slower to manipulate within the map algebra environment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this "hook" to numpy rasters going to be available in beta 2? If not what is a workaround to try in the meantime?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2010 16:19:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479715#M6903</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2010-01-26T16:19:05Z</dc:date>
    </item>
    <item>
      <title>Numpy Array</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479716#M6904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Curtis,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm looking into this for you and hopefully will be able to post later this afternoon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2010 14:57:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479716#M6904</guid>
      <dc:creator>EricRice</dc:creator>
      <dc:date>2010-01-27T14:57:47Z</dc:date>
    </item>
    <item>
      <title>"built-in" rasters in python map algebra</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479717#M6905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;RasterToNumpyArray and NumpyArrayToRaster functions are are available in arcpy in 9.4 beta2.&amp;nbsp; Be aware there are some known issues but in general they are working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a basic syntax&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RasterToNumPyArray (in_raster, {lower_left_corner}, {ncols}, {nrows}, {nodata_to_value})&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NumPyArrayToRaster (in_array, {lower_left_corner}, {x_cell_size}, {y_cell_size}, {value_to_nodata})&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;link to beta web help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://helpdev.esri.com/EN/ArcGISDesktop/9.4/Help/index.html#/NumPyArrayToRaster/000V00000130000000/"&gt;http://helpdev.esri.com/EN/ArcGISDesktop/9.4/Help/index.html#/NumPyArrayToRaster/000V00000130000000/&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://helpdev.esri.com/EN/ArcGISDesktop/9.4/Help/index.html#/RasterToNumPyArray/000V0000012Z000000/"&gt;http://helpdev.esri.com/EN/ArcGISDesktop/9.4/Help/index.html#/RasterToNumPyArray/000V0000012Z000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Ryan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2010 15:52:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479717#M6905</guid>
      <dc:creator>RyanDeBruyn</dc:creator>
      <dc:date>2010-01-27T15:52:09Z</dc:date>
    </item>
    <item>
      <title>helpdev</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479718#M6906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't seem to have access to helpdev.esri.com. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there another site that is accessible to beta testers outside ESRI?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 17:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479718#M6906</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2010-02-01T17:36:53Z</dc:date>
    </item>
    <item>
      <title>"built-in" rasters in python map algebra</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479719#M6907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ooops!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can just take the "dev" out of the link and it should line up the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I believe these are the external version of the links Ryan was posting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.esri.com/EN/ArcGISDesktop/9.4/Help/index.html#/NumPyArrayToRaster/000V00000130000000/"&gt;http://help.esri.com/EN/ArcGISDesktop/9.4/Help/index.html#/NumPyArrayToRaster/000V00000130000000/&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://help.esri.com/EN/ArcGISDesktop/9.4/Help/index.html#/RasterToNumPyArray/000V0000012Z000000/"&gt;http://help.esri.com/EN/ArcGISDesktop/9.4/Help/index.html#/RasterToNumPyArray/000V0000012Z000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 17:46:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479719#M6907</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2010-02-01T17:46:37Z</dc:date>
    </item>
    <item>
      <title>Online help URLs</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479720#M6908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That was it! Those links work.&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 21:04:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479720#M6908</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2010-02-01T21:04:23Z</dc:date>
    </item>
    <item>
      <title>NumPyArray to Raster And Back Again</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479721#M6909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A mole from the geoprocessing team sent me this neat example.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This method could be used to generate $$XMAP and $$YMAP using the environment raster extent and cell size.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sure would be nice to include a script tool in the Arc 10 toolbox to both serve as a simple example of how to use NumpyArrayToRaster, and keep the functionality in the standard product. Otherwise the handfull of geeks that use this functionality will have to do it ourselves. Here's the (now trivial, with the example below) tool I will probably write if you don't release one:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;CreateLocationRaster &amp;lt;Out_raster&amp;gt; {ROWMAP | COLMAP | XMAP | YMAP} {Template_raster}&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
## NumPyArrayToRaster (in_array, {lower_left_corner},
##&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {x_cell_size}, {y_cell_size}, {value_to_nodata})

import os, sys, arcpy 
import numpy as NUM
 
# Set path
sPath = sys.path[0]
outPath = os.path.join(os.path.dirname(sPath),"output")
 
# Set environment
arcpy.env.workspace = outPath
arcpy.env.overwriteOutput = 1
 
#------------------------------------------
# Create and populate an array
myArray = NUM.zeros((10,16),dtype='int16')
 
# Fill row with row number
for i in range(0,10):
&amp;nbsp; myArray&lt;I&gt; = i + 1
print myArray
 
# Create a raster
rowRas = arcpy.NumPyArrayToRaster(myArray)
rowRas.save("rowRas")
print "...saved rowras"
 
#------------------------------------------
# Fill col with col number
for j in range(0,16):
&amp;nbsp; myArray[:,j] = j+1
print myArray

# Create a raster
colRas = arcpy.NumPyArrayToRaster(myArray)
colRas.save("colRas")
print "...saved colras"
&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And here's another (certifiably cool) way to do it, sent by a USGS colleague... using the NumPy "indices" method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; import numpy as np
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Setup some rasters of rows and columns
&amp;nbsp;&amp;nbsp;&amp;nbsp; # (like old $$ROWMAP and $$COLMAP)
&amp;nbsp;&amp;nbsp;&amp;nbsp; nprows = np.indices((10,10))[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; npcols = np.indices((10,10))[1]

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Convert the numpy arrays to ESRI rasters (ie Raster objects)
&amp;nbsp;&amp;nbsp;&amp;nbsp; # called 'rows' and 'cols'
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.NumPyArrayToRaster(nprows)
&amp;nbsp;&amp;nbsp;&amp;nbsp; cols = arcpy.NumPyArrayToRaster(npcols)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:31:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479721#M6909</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T16:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Beta 10: "built-in" rasters in python map algebra</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479722#M6910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Has there been any movement on this in terms of including a script or built-in tool in Arc 10?&amp;nbsp; If not, can you tell me is the script above intended to be run in the raster calculator or as a script in a model or toolbox?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2011 14:06:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479722#M6910</guid>
      <dc:creator>MarkCarroll</dc:creator>
      <dc:date>2011-12-27T14:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: "Built-in" rasters in python map algebra</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479723#M6911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's been more recent discussion on this topic here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/message/236639"&gt;$$NCOLS + $$ROWMAP in ArcGIS 10 Python map algebra&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Nov 2014 00:53:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/quot-built-in-quot-rasters-in-python-map-algebra/m-p/479723#M6911</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-11-29T00:53:56Z</dc:date>
    </item>
  </channel>
</rss>

