<?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 $$NCOLS + $$ROWMAP in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272289#M3880</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for this! I'm new to both rasters and Python so code like this is a HUGE help. However, I think there's a small bug.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Shouldn't the xmap setting be adding XMin instead of YMin at the end? I.e.,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;xmap = (FlowAccumulation(tmpg) + 0.5) * cellSize + E.extent.XMin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for the code, very useful.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Apr 2013 15:15:53 GMT</pubDate>
    <dc:creator>CameronScott</dc:creator>
    <dc:date>2013-04-10T15:15:53Z</dc:date>
    <item>
      <title>$$NCOLS + $$ROWMAP</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272287#M3878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do we implement $$NCOLS + $$ROWMAP in map calculator? I would appreciate any advice. My email: &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:yong.q.tian@gmail.com"&gt;yong.q.tian@gmail.com&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2012 01:44:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272287#M3878</guid>
      <dc:creator>YongTian</dc:creator>
      <dc:date>2012-01-21T01:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: $$NCOLS + $$ROWMAP</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272288#M3879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unsuported in new v10.0 Map Algebra! Although you can get $$NCOLS through the describe property in Python or the GetRasterProperties toolbox tool. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See: &lt;/SPAN&gt;&lt;A href="https://c.na1.visual.force.com/apex/ideaView?id=087300000008DT2AAM#comments"&gt;https://c.na1.visual.force.com/apex/ideaView?id=087300000008DT2AAM#comments&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can still use the good ole' Map Algebra sytax in v10 though:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.gp.SingleOutputMapAlgebra_sa(blah, blah)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2012 16:56:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272288#M3879</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2012-01-24T16:56:21Z</dc:date>
    </item>
    <item>
      <title>$$NCOLS + $$ROWMAP</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272289#M3880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for this! I'm new to both rasters and Python so code like this is a HUGE help. However, I think there's a small bug.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Shouldn't the xmap setting be adding XMin instead of YMin at the end? I.e.,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;xmap = (FlowAccumulation(tmpg) + 0.5) * cellSize + E.extent.XMin&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for the code, very useful.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 15:15:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272289#M3880</guid>
      <dc:creator>CameronScott</dc:creator>
      <dc:date>2013-04-10T15:15:53Z</dc:date>
    </item>
    <item>
      <title>$$NCOLS + $$ROWMAP in ArcGIS 10 Python map algebra</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272290#M3881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Here's an implementation of&amp;nbsp;&amp;nbsp; &lt;A href="https://community.esri.com/migrated-users/62455" target="_blank"&gt;William Huber&lt;/A&gt;'s neat idea of using the FlowAccumulation tool to generate xmap and&amp;nbsp; ymap. This uses the current processing environment, it will generate an error if the arcpy.env.extent or cellSize are not explicitly set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: italic;"&gt;(this code has a bug fixed - thanks &lt;A href="https://community.esri.com/migrated-users/32107" target="_blank"&gt;Cameron!&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from arcpy.sa import *
from arcpy import env as E
# Calculate $$NROWS and $$NCOLS from current environment
cellSize = float(E.cellSize)
nrows = int((E.extent.YMax - E.extent.YMin) / float(E.cellSize))
ncols = int((E.extent.XMax - E.extent.XMin)&amp;nbsp; / float(E.cellSize))
# Bill Huber's method for $$XMAP and $$YMAP: "1" flows "right", "64" (63+1) flows "up"
tmpg = CreateConstantRaster(1)
xmap = (FlowAccumulation(tmpg) + 0.5) * cellSize + E.extent.XMin
ymap = (FlowAccumulation(tmpg + 63) + 0.5) * cellSize + E.extent.YMin
# applying the same method for $$ROWMAP and $$COLMAP
colmap = Int(FlowAccumulation(tmpg))
rowmap = Int(FlowAccumulation(tmpg + 3))&amp;nbsp; # flowdir "4" is "down" (top row is 0)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:17:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272290#M3881</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T13:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: $$NCOLS + $$ROWMAP in ArcGIS 10 Python map algebra</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272291#M3882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's always cool to see some of &lt;A href="https://community.esri.com/migrated-users/62455"&gt;William Huber&lt;/A&gt;‌ ideas revive!&lt;/P&gt;&lt;P&gt;Thanx for sharing &lt;A href="https://community.esri.com/migrated-users/3355"&gt;Curtis Price&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Nov 2014 17:55:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272291#M3882</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-11-29T17:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: $$NCOLS + $$ROWMAP</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272292#M3883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem, I was just resurrecting some old posts of mine, getting them tagged and placed in GeoNet where they will be easier to find.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 04:13:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/ncols-rowmap/m-p/272292#M3883</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-12-02T04:13:09Z</dc:date>
    </item>
  </channel>
</rss>

