<?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 How can I assign grid values to the squares of a fishnet grid? in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105255#M1221</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I am working with a fishnet grid that I created but cannot figure out how to populate the attribute table of the shapefile with the corresponding grid designation.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 10pt; background-color: rgba(248, 248, 248, 0.6);"&gt;The details of the grid are as follows:&lt;BR /&gt;The X of the grid originally started with A and ended with AX. We have since had to broaden it both east and west to include YE through ZZ, then A through CT (so 146 columns in the grid). The Y of the grid is 1 through 147.&amp;nbsp; Each grid square is 5x5 meters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 10pt; background-color: rgba(248, 248, 248, 0.6);"&gt;There must be something I am missing in order to assign grid values to each square.&amp;nbsp; I have played around a bit with &lt;SPAN style="color: #444444; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #fafafa;"&gt;attribute assist, and editing a grid template for Make Grids and Graticules Layer (both of which are new to me).&amp;nbsp; I have also started playing around with creating rows and columns of polygons named according to the grid and named accordingly and spatially joining them with the grid squares...&amp;nbsp; I haven't quite been able to figure it out with any of these, and I figure there must be a simpler way, right?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #fafafa; color: #444444; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #fafafa; color: #444444; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;Ryan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Jun 2015 13:02:46 GMT</pubDate>
    <dc:creator>RyanGardner-Cook</dc:creator>
    <dc:date>2015-06-09T13:02:46Z</dc:date>
    <item>
      <title>How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105255#M1221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I am working with a fishnet grid that I created but cannot figure out how to populate the attribute table of the shapefile with the corresponding grid designation.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 10pt; background-color: rgba(248, 248, 248, 0.6);"&gt;The details of the grid are as follows:&lt;BR /&gt;The X of the grid originally started with A and ended with AX. We have since had to broaden it both east and west to include YE through ZZ, then A through CT (so 146 columns in the grid). The Y of the grid is 1 through 147.&amp;nbsp; Each grid square is 5x5 meters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 10pt; background-color: rgba(248, 248, 248, 0.6);"&gt;There must be something I am missing in order to assign grid values to each square.&amp;nbsp; I have played around a bit with &lt;SPAN style="color: #444444; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #fafafa;"&gt;attribute assist, and editing a grid template for Make Grids and Graticules Layer (both of which are new to me).&amp;nbsp; I have also started playing around with creating rows and columns of polygons named according to the grid and named accordingly and spatially joining them with the grid squares...&amp;nbsp; I haven't quite been able to figure it out with any of these, and I figure there must be a simpler way, right?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #fafafa; color: #444444; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #fafafa; color: #444444; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;Ryan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 13:02:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105255#M1221</guid>
      <dc:creator>RyanGardner-Cook</dc:creator>
      <dc:date>2015-06-09T13:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105256#M1222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could recreate the grid with Create Grid Index tool &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00700000000q000000" title="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00700000000q000000"&gt;ArcGIS Desktop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Or you could assign use arcpy.Sort_management to spatially sort the grid you have and use the new object IDs to populate your IDs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 19:19:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105256#M1222</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-06-09T19:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105257#M1223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it has to be the YE to ZZ and A to CT and the &lt;A href="http://desktop.arcgis.com/en/desktop/latest/map/page-layouts/creating-grid-index-features.htm"&gt;Create Grid Index&lt;/A&gt; as &lt;A href="https://community.esri.com/migrated-users/16710"&gt;Wes Miller&lt;/A&gt; suggests, does not produce what you want, I suppose it would be possible to create a python script that will assign the grid values automatically.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 01:27:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105257#M1223</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-06-10T01:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105258#M1224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And to give an example:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/108410_pastedImage_9.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Was created using this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

def main():
&amp;nbsp;&amp;nbsp;&amp;nbsp; # the fishnet featureclass
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc = r"C:\Forum\FishIndex\test.gdb\indexgrid01"

&amp;nbsp;&amp;nbsp;&amp;nbsp; # fields to will be updated (should exist)
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_row = "row"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_col = "col"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_idx = "GridIndex"

&amp;nbsp;&amp;nbsp;&amp;nbsp; # extent (all lower left of fishnet polygons)
&amp;nbsp;&amp;nbsp;&amp;nbsp; xmin = 150000
&amp;nbsp;&amp;nbsp;&amp;nbsp; ymin = 450000
&amp;nbsp;&amp;nbsp;&amp;nbsp; xmax = 150725
&amp;nbsp;&amp;nbsp;&amp;nbsp; ymax = 450730
&amp;nbsp;&amp;nbsp;&amp;nbsp; width = 5
&amp;nbsp;&amp;nbsp;&amp;nbsp; height = 5

&amp;nbsp;&amp;nbsp;&amp;nbsp; # update features
&amp;nbsp;&amp;nbsp;&amp;nbsp; flds = ("SHAPE@", fld_row, fld_col, fld_idx)
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.UpdateCursor(fc, flds) as curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ext = row[0].extent
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rownum = getRowNumber(ext.YMin, ymax, height)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; colnum = getColNumber(ext.XMin, xmin, width)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; idxnum = getIndex(colnum, rownum)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[1] = rownum
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[2] = colnum
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[3] = idxnum
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curs.updateRow(row)

def getRowNumber(yi, ymax, height):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return int((ymax - yi) / height + 1)

def getColNumber(xi, xmin, width):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return int((xi - xmin) / width + 1)

def getIndex(col, row):
&amp;nbsp;&amp;nbsp;&amp;nbsp; col = correctCol(col)
&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://stackoverflow.com/questions/19153462/python-get-excel-style-column-names-from-column-number" rel="nofollow noopener noreferrer" target="_blank"&gt;http://stackoverflow.com/questions/19153462/python-get-excel-style-column-names-from-column-number&lt;/A&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
&amp;nbsp;&amp;nbsp;&amp;nbsp; result = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; while col:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; col, rem = divmod(col-1, 26)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result[:0] = LETTERS[rem]
&amp;nbsp;&amp;nbsp;&amp;nbsp; return ''.join(result) + str(row)

def correctCol(col):
&amp;nbsp;&amp;nbsp;&amp;nbsp; # YE through ZZ, then A through CT
&amp;nbsp;&amp;nbsp;&amp;nbsp; YE, ZZ = 655, 702
&amp;nbsp;&amp;nbsp;&amp;nbsp; if col &amp;lt;= (ZZ - YE + 1):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return col + YE -1
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return col - (ZZ - YE + 1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; return col

if __name__ == '__main__':
&amp;nbsp;&amp;nbsp;&amp;nbsp; main()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:25:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105258#M1224</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T06:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105259#M1225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, this worked brilliantly!!!&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a shame that there isn't a tool for this.&amp;nbsp; I have wanted to get into python scripting a bit more as my team's GIS needs increase.&amp;nbsp; Do you have any recommendations for tutorials to get going with?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 09:42:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105259#M1225</guid>
      <dc:creator>RyanGardner-Cook</dc:creator>
      <dc:date>2015-06-10T09:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105260#M1226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The index tool wasn't doing it for me.&amp;nbsp; Had Xander's script not worked, do you have any recommendations for how I should have automatically populated my IDs after sorting the grid?&amp;nbsp; Do the columns and rows separately and then concat?&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 09:45:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105260#M1226</guid>
      <dc:creator>RyanGardner-Cook</dc:creator>
      <dc:date>2015-06-10T09:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105261#M1227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is relatively easy to create a tool from it, but this would probably require some more intelligence on detecting the size of the fishnet grids and rows and columns (&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Adding_a_script_tool/00150000001r000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/Adding_a_script_tool/00150000001r000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some resources for learning Python/arcpy...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;python:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://learnpythonthehardway.org/" title="http://learnpythonthehardway.org/"&gt;Learn Python&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.diveintopython.net/" title="http://www.diveintopython.net/"&gt;Dive Into Python&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://www.coursera.org/courses?query=python" title="https://www.coursera.org/courses?query=python"&gt;Coursera - Free Online Courses From Top Universities&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.codecademy.com/" title="http://www.codecademy.com/"&gt;Learn to code | Codecademy&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://interactivepython.org/runestone/static/thinkcspy/toc.html" title="http://interactivepython.org/runestone/static/thinkcspy/toc.html"&gt;Table of Contents — How to Think like a Computer Scientist: Interactive Edition&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://www.udemy.com/python-for-beginners/" title="https://www.udemy.com/python-for-beginners/"&gt;Python for Beginners - Python Training Course - Udemy&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;books:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://esripress.esri.com/display/index.cfm" title="http://esripress.esri.com/display/index.cfm"&gt;Esri Press | GIS Books &amp;amp; Tutorials - Buy Books Online&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.rmi.net/~lutz/about-lp5e.html" title="http://www.rmi.net/~lutz/about-lp5e.html"&gt;Learning Python, 5th Edition&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;arcpy:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://training.esri.com/gateway/index.cfm?fa=search.results&amp;amp;searchterm=python" title="http://training.esri.com/gateway/index.cfm?fa=search.results&amp;amp;searchterm=python"&gt;Esri Training&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/communities/python/" title="http://resources.arcgis.com/en/communities/python/"&gt;Python for ArcGIS | ArcGIS Resource Center&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;some blogs in GeoNet:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/docs/DOC-1927"&gt;Some Python Snippets&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/1167"&gt;Dan Patterson's Blog&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/1456"&gt;Richard Fairhurst's Blog&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/1209"&gt;Tilting at Globes&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/1848"&gt;Curtis Price's Blog&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;...and of course:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://arcpy.wordpress.com/" title="https://arcpy.wordpress.com/"&gt;ArcPy Café | Get all your ArcGIS Python Recipes here!&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/What_is_Python/002z00000001000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/What_is_Python/002z00000001000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/What_is_ArcPy/000v000000v7000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/What_is_ArcPy/000v000000v7000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy/what-is-arcpy-.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy/what-is-arcpy-.htm"&gt;What is ArcPy?—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/main/arcgis-pro-arcpy-reference.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/main/arcgis-pro-arcpy-reference.htm"&gt;ArcGIS Pro ArcPy Reference—ArcGIS Pro | ArcGIS for Professionals&lt;/A&gt;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 11:56:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105261#M1227</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-06-10T11:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105262#M1228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and to add some explanation to the code:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;line 5 holds a reference to the input feature class (fishnet)&lt;/LI&gt;&lt;LI&gt;lines 8 - 10, define the names of the field that are being updated (should already exist in the input fc)&lt;/LI&gt;&lt;LI&gt;lines 13 - 18, define the fishnet (the upper right corner is actually the lower left corner of the upper right polygon)&lt;/LI&gt;&lt;LI&gt;line 21, creates a tuple with the fields to be used in the cursor&lt;/LI&gt;&lt;LI&gt;line 22, defines the cursor (this is something that allows you to traverse the data and in this case update the data), very important to look into cursors and the data access (da) module&lt;/LI&gt;&lt;LI&gt;line 23, start looping through each record in the featureclass&lt;/LI&gt;&lt;LI&gt;line 24, read the extent property of the geometry&lt;/LI&gt;&lt;LI&gt;line 25, determine the row number based on the Ymin of the extent and the height of the grid&lt;/LI&gt;&lt;LI&gt;line 26, determine the column number based on the Xmin of the extent and the width of the grid&lt;/LI&gt;&lt;LI&gt;line 27, determine the grid index based on row and column numbers&lt;/LI&gt;&lt;LI&gt;lines 28 - 30, write the results to the row object&lt;/LI&gt;&lt;LI&gt;line 31, updates the record&lt;/LI&gt;&lt;LI&gt;lines 33 - 34, the function that calculates the row number&lt;/LI&gt;&lt;LI&gt;lines 36 - 37, the function that calculates the column number&lt;/LI&gt;&lt;LI&gt;lines 39 to 47, calls the function correctCol on line 49 to correct column number for your specific case and converts the column into an Excel like notation.&lt;/LI&gt;&lt;LI&gt;lines 49 - 56, changes the column number to create the value corresponding to YE-ZZ and A to CT column number values&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 12:08:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105262#M1228</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-06-10T12:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105263#M1229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for the list of resources!&amp;nbsp; The explanation of the code helps immensely as well.&amp;nbsp; I've played around with R a bit and they seem pretty similar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 13:38:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105263#M1229</guid>
      <dc:creator>RyanGardner-Cook</dc:creator>
      <dc:date>2015-06-10T13:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105264#M1230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Sort_managment tool would have sorted your tiles spatially, see below.&lt;/P&gt;&lt;P&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&lt;/P&gt;&lt;P&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&lt;/P&gt;&lt;P&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 16&lt;/P&gt;&lt;P&gt;Your table would have been in a spatially logical order. Use the line below in your ArcMap python window and change "YourGridHere" with your fishnnet grid to see how it works&lt;/P&gt;&lt;P&gt;arcpy.Sort_management("YourGridHere","in_memory\\YourGridUL","Shape","UL")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 13:42:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105264#M1230</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-06-10T13:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105265#M1231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P dir="ltr" style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px;"&gt;Hi Xander,&lt;BR /&gt;I am hoping you can help clarify a couple things for me, please.&lt;/P&gt;&lt;P dir="ltr" style="color: #222222; font-family: arial, sans-serif; font-size: 12.8000001907349px;"&gt;I am playing around with the script a bit, trying to make different grid schemes.&amp;nbsp; I am getting errors on lines 22 and 54.&amp;nbsp; Will the cursor be totally different if I am just doing an AA through GS grid?&amp;nbsp; I also cut down lines 49-56 to &lt;BR /&gt;# AA through GS&lt;BR /&gt;Return col&lt;BR /&gt;Is that correct?&lt;BR /&gt;Sorry to trouble you and thanks so much for your time and expertise!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 07:21:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105265#M1231</guid>
      <dc:creator>RyanGardner-Cook</dc:creator>
      <dc:date>2015-06-12T07:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105266#M1232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/146601"&gt;Ryan Gardner-Cook&lt;/A&gt; , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An error on line 22 (initializing the update cursor) normally occurs when:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;the featureclass cannot be found, accessed or updated&lt;/LI&gt;&lt;LI&gt;the tuple of fields contains a field that does not exist&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An error on line 54 is a bit strange, but this might be due to cutting down lines 49-56 or some indentation. it would help to see the entire error message to determine what is going on. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To simply create a grid that that starts a a single A and continue up to GS (?) would only require you to switch off the correction of the column number on line 40 or the original code. You can put a "#" sign before the line to comment the line and prevent it from executing, like you can see on line 41 where the source url is a comment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2015 12:14:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105266#M1232</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-06-12T12:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105267#M1233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the idea is to start with a double A (i.e. AA) through, in this case, GR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the error:&lt;/P&gt;&lt;P&gt;Runtime error&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 54, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 22, in main&lt;/P&gt;&lt;P&gt;RuntimeError: cannot open 'C:\JVRP\Legio_Grid.shp'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the same error after switching off line 40.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think part of the problem, at least, is the feature class location...&amp;nbsp; The data source says the database is in a location separate from the shapefile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: Yeah, that was creating the error.&amp;nbsp; Now the issue is that the first square in the grid is A0, as opposed to AA1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Jun 2015 07:43:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105267#M1233</guid>
      <dc:creator>RyanGardner-Cook</dc:creator>
      <dc:date>2015-06-13T07:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105268#M1234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should change the function that corrects the column number. So replace lines 49 - 56 by these lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def correctCol(col):
&amp;nbsp;&amp;nbsp;&amp;nbsp; # starting at AA
&amp;nbsp;&amp;nbsp;&amp;nbsp; return col + 26&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will yield a column number that will start at AA (=27).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error that make your rows start at 0 (probably due to the extent defined) can be easiest (quick and dirty) corrected by simply adding 1 to the row number at line 25:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rownum = getRowNumber(ext.YMin, ymax, height) + 1&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The alternative would be to check the extent defined and adjust accordingly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:25:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105268#M1234</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T06:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105269#M1235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fantastic, thank you Xander!&amp;nbsp; This has been immensely helpful.&amp;nbsp; We're out in the field for a limited amount of time and you have no idea how important these things were.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 13:55:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105269#M1235</guid>
      <dc:creator>RyanGardner-Cook</dc:creator>
      <dc:date>2015-06-15T13:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I assign grid values to the squares of a fishnet grid?</title>
      <link>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105270#M1236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it was helpful! You're welcome&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 17:24:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/how-can-i-assign-grid-values-to-the-squares-of-a/m-p/105270#M1236</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-06-15T17:24:39Z</dc:date>
    </item>
  </channel>
</rss>

