<?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 Generate ID from grid using centroid in State &amp; Local Government Questions</title>
    <link>https://community.esri.com/t5/state-local-government-questions/generate-id-from-grid-using-centroid/m-p/300408#M1820</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to auto generate tract numbers based upon where they fall in a grid system (actually abstracts in Texas).&amp;nbsp; My problem is that where a tract joins a grid boundary (very common in this dataset), I get the first value it finds, even though it may be completely contained within the the second grid.&amp;nbsp; I have used the Intersection Features tool with the centroid option in the past, but I manually had to update the ID.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to use the GENERATE_ID_BY_INTERSECT method with centroids?&amp;nbsp; Is it possible to edit the code to change this to centroid (all the time would be fine for me) like the &lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;INTERSECTING_FEATURE method?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;Or is there a way to do this as a two step process, &lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;INTERSECTING_FEATURE to pull the gridID first, and then GENERATE_ID (or some other method) to pull an ID from the GenerateID table from the row for that GridID&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;I am running ArcGIS Standard 10.2.2 with the AA 10.2.0.4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;George&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Sep 2014 15:00:31 GMT</pubDate>
    <dc:creator>GeorgeMiddlebrook</dc:creator>
    <dc:date>2014-09-24T15:00:31Z</dc:date>
    <item>
      <title>Generate ID from grid using centroid</title>
      <link>https://community.esri.com/t5/state-local-government-questions/generate-id-from-grid-using-centroid/m-p/300408#M1820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to auto generate tract numbers based upon where they fall in a grid system (actually abstracts in Texas).&amp;nbsp; My problem is that where a tract joins a grid boundary (very common in this dataset), I get the first value it finds, even though it may be completely contained within the the second grid.&amp;nbsp; I have used the Intersection Features tool with the centroid option in the past, but I manually had to update the ID.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to use the GENERATE_ID_BY_INTERSECT method with centroids?&amp;nbsp; Is it possible to edit the code to change this to centroid (all the time would be fine for me) like the &lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;INTERSECTING_FEATURE method?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;Or is there a way to do this as a two step process, &lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;INTERSECTING_FEATURE to pull the gridID first, and then GENERATE_ID (or some other method) to pull an ID from the GenerateID table from the row for that GridID&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;I am running ArcGIS Standard 10.2.2 with the AA 10.2.0.4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12px;"&gt;George&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 15:00:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/generate-id-from-grid-using-centroid/m-p/300408#M1820</guid>
      <dc:creator>GeorgeMiddlebrook</dc:creator>
      <dc:date>2014-09-24T15:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Generate ID from grid using centroid</title>
      <link>https://community.esri.com/t5/state-local-government-questions/generate-id-from-grid-using-centroid/m-p/300409#M1821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried the option "Have Their Centroid In?"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14115714572547479 jive_text_macro" jivemacro_uid="_14115714572547479" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;arcpy.SelectLayerByLocation_management("Grid", "HAVE_THEIR_CENTER_IN", "Tract", "0 FEET", "NEW_SELECTION")&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 15:11:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/generate-id-from-grid-using-centroid/m-p/300409#M1821</guid>
      <dc:creator>GeoffOlson</dc:creator>
      <dc:date>2014-09-24T15:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Generate ID from grid using centroid</title>
      <link>https://community.esri.com/t5/state-local-government-questions/generate-id-from-grid-using-centroid/m-p/300410#M1822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I really want to use the Attribute Assistant to do this, as we will be adding new tracts all the time.&amp;nbsp; Is there a way customize AA with ArcPy?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 15:31:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/generate-id-from-grid-using-centroid/m-p/300410#M1822</guid>
      <dc:creator>GeorgeMiddlebrook</dc:creator>
      <dc:date>2014-09-24T15:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Generate ID from grid using centroid</title>
      <link>https://community.esri.com/t5/state-local-government-questions/generate-id-from-grid-using-centroid/m-p/300411#M1823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;EDIT:&amp;nbsp; Attribute Assistant 10.2.0.4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 15:32:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/generate-id-from-grid-using-centroid/m-p/300411#M1823</guid>
      <dc:creator>GeorgeMiddlebrook</dc:creator>
      <dc:date>2014-09-24T15:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Generate ID from grid using centroid</title>
      <link>https://community.esri.com/t5/state-local-government-questions/generate-id-from-grid-using-centroid/m-p/300412#M1824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My use of Attribute Assistance is very limited.&amp;nbsp; My knowledge of Python is relatively small, but one thing I've done several times is customizing a script to move attribute data from one feature class to another based on spatial selection.&amp;nbsp; I use a search cursor to loop through the layer of data I need extracted, then I query that layer in the loop, followed by a select by location and field calculation.&amp;nbsp; Then I remove the definition query at the end of the loop.&amp;nbsp; This is what I'm using right now to do something similar - I think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14115732184321796" jivemacro_uid="_14115732184321796" modifiedtitle="true"&gt;
&lt;P&gt;mxd = arcpy.mapping.MapDocument("Current")# Define mxd to current file.&lt;/P&gt;
&lt;P&gt;townships = arcpy.da.SearchCursor("Townships", "name")&lt;/P&gt;
&lt;P&gt;for township in townships:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; tName = township[0]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; cName = '''"{0}"'''.format(tName)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; mapLyr1.definitionQuery = """"name" = '{0}'""".format(tName)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; arcpy.SelectLayerByLocation_management("Layer2", "INTERSECT", "Townships", "0 FEET", "NEW_SELECTION")&lt;/P&gt;
&lt;P&gt;&amp;nbsp; arcpy.CalculateField_management("Layer2", "Jurisdicti", cName, "PYTHON")&lt;/P&gt;
&lt;P&gt;&amp;nbsp; mapLyr1.definitionQuery = None&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This takes the township name and places in Layer2's field.&amp;nbsp; You can do many things with this basic setup, though it can take some time to run when there are hundreds or thousands of features.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 15:42:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/generate-id-from-grid-using-centroid/m-p/300412#M1824</guid>
      <dc:creator>GeoffOlson</dc:creator>
      <dc:date>2014-09-24T15:42:59Z</dc:date>
    </item>
  </channel>
</rss>

