<?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: Arcade or Python:  Calc field to create line between two points in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-or-python-calc-field-to-create-line-between/m-p/1327634#M72942</link>
    <description>&lt;P&gt;I'm not really sure what your question is...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Do you have a table like this and want to construct the lines?&lt;UL&gt;&lt;LI&gt;Use &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/xy-table-to-point.htm" target="_blank" rel="noopener"&gt;XY Table To Point&lt;/A&gt; to convert the coordinates to points&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Use &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/points-to-line.htm" target="_blank" rel="noopener"&gt;Points To Line&lt;/A&gt; to convert the points to lines&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Do you have a coordinate table and want to calculate the ID field like in your example?&lt;UL&gt;&lt;LI&gt;Use &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm" target="_blank" rel="noopener"&gt;Calculate Field&lt;/A&gt; with this Python expression:&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="python"&gt;# UniqueID = 
get_id()

# Code Block
i = 0
is_second = True

def get_id():
    global i
    global is_second
    is_second = not is_second
    if not is_second:
        i += 1
    return i&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 12 Sep 2023 10:16:55 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2023-09-12T10:16:55Z</dc:date>
    <item>
      <title>Arcade or Python:  Calc field to create line between two points</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-or-python-calc-field-to-create-line-between/m-p/1327453#M72932</link>
      <description>&lt;P&gt;Does anybody have any ideas in Arcade or Python on how to calc the Unique ID field, like is shown below?&amp;nbsp; The two points connected by the line have the same Unique ID....&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ArmstKP_0-1694464393525.png" style="width: 642px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80354iC01E96F1C2B605B4/image-dimensions/642x473?v=v2" width="642" height="473" role="button" title="ArmstKP_0-1694464393525.png" alt="ArmstKP_0-1694464393525.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 20:49:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-or-python-calc-field-to-create-line-between/m-p/1327453#M72932</guid>
      <dc:creator>ArmstKP</dc:creator>
      <dc:date>2023-09-11T20:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade or Python:  Calc field to create line between two points</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-or-python-calc-field-to-create-line-between/m-p/1327634#M72942</link>
      <description>&lt;P&gt;I'm not really sure what your question is...&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Do you have a table like this and want to construct the lines?&lt;UL&gt;&lt;LI&gt;Use &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/xy-table-to-point.htm" target="_blank" rel="noopener"&gt;XY Table To Point&lt;/A&gt; to convert the coordinates to points&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Use &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/points-to-line.htm" target="_blank" rel="noopener"&gt;Points To Line&lt;/A&gt; to convert the points to lines&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Do you have a coordinate table and want to calculate the ID field like in your example?&lt;UL&gt;&lt;LI&gt;Use &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm" target="_blank" rel="noopener"&gt;Calculate Field&lt;/A&gt; with this Python expression:&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="python"&gt;# UniqueID = 
get_id()

# Code Block
i = 0
is_second = True

def get_id():
    global i
    global is_second
    is_second = not is_second
    if not is_second:
        i += 1
    return i&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Sep 2023 10:16:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-or-python-calc-field-to-create-line-between/m-p/1327634#M72942</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-09-12T10:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade or Python:  Calc field to create line between two points</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-or-python-calc-field-to-create-line-between/m-p/1327730#M72959</link>
      <description>&lt;P&gt;As Johannes said, your question isn't quite clear.&lt;/P&gt;&lt;P&gt;If you're generating the points from lines you could:&lt;/P&gt;&lt;P&gt;- use the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/feature-vertices-to-points.htm" target="_self"&gt;Feature Vertices to Points&lt;/A&gt;&amp;nbsp; tool which will generate a feature class of points that contain the original FID of the line they came from.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- If you have an existing table of points that you want to keep you could then do a spatial join between the table from the tool and your original points and field calculate the&amp;nbsp; original FID into it.&lt;/P&gt;&lt;P&gt;- Or take the point table generated from the line feature class in the tool and Calculate Geometry attributes for the coordinates.&lt;/P&gt;&lt;P&gt;As a second option you could make a point class from your table and then do a spatial join with the lines and field calc the id into it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have no line feature class, this is just a table and the points are listed in pairs, then use the python script Johannes posted above to assign an ID to each set of points.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 14:37:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-or-python-calc-field-to-create-line-between/m-p/1327730#M72959</guid>
      <dc:creator>TrevisMartin</dc:creator>
      <dc:date>2023-09-12T14:37:55Z</dc:date>
    </item>
  </channel>
</rss>

