<?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 Extract first segment of polylines in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/extract-first-segment-of-polylines/m-p/1183011#M56196</link>
    <description>&lt;P&gt;I have a multipart polyline FC in an SDE.ST_GEOMETRY EGDB (Oracle 18c).&lt;/P&gt;&lt;P&gt;For testing purposes, I want to create a new polyline FC that only has the &lt;STRONG&gt;first segment of the original lines&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1655270162782.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43505i85DFB70F7909E933/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_0-1655270162782.png" alt="Bud_0-1655270162782.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For multi-part features, I want to ignore the additional parts. For example, I don't want to get the first segment of the second part.&lt;/LI&gt;&lt;LI&gt;It's a one-time operation, so using geoprocessing tools would be fine (no need for automation or custom scripting).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;How can I do that using ArcGIS Pro 2.6.8 or ArcMap 10.7.1? (advanced license)&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2022 06:00:37 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2022-06-15T06:00:37Z</dc:date>
    <item>
      <title>Extract first segment of polylines</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-first-segment-of-polylines/m-p/1183011#M56196</link>
      <description>&lt;P&gt;I have a multipart polyline FC in an SDE.ST_GEOMETRY EGDB (Oracle 18c).&lt;/P&gt;&lt;P&gt;For testing purposes, I want to create a new polyline FC that only has the &lt;STRONG&gt;first segment of the original lines&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1655270162782.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43505i85DFB70F7909E933/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_0-1655270162782.png" alt="Bud_0-1655270162782.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For multi-part features, I want to ignore the additional parts. For example, I don't want to get the first segment of the second part.&lt;/LI&gt;&lt;LI&gt;It's a one-time operation, so using geoprocessing tools would be fine (no need for automation or custom scripting).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;How can I do that using ArcGIS Pro 2.6.8 or ArcMap 10.7.1? (advanced license)&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 06:00:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-first-segment-of-polylines/m-p/1183011#M56196</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-06-15T06:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract first segment of polylines</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-first-segment-of-polylines/m-p/1183013#M56197</link>
      <description>&lt;P&gt;You can try the following:&lt;/P&gt;&lt;P&gt;1. Run Feature Vertices To Points with START (start vertex) option. The output, say startPoints, should contain start points of input lines.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/feature-vertices-to-points.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/feature-vertices-to-points.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2. Run Split Line At Vertices which breaks lines at vertices. Let's call the output splitLines.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/split-line-at-vertices.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/2.8/tool-reference/data-management/split-line-at-vertices.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;3. Use Select Layer By Location to select splitLines that are "Within a distance" to startPoints. Since the lines should be touching the start points, you can set a very small Search Distance, e.g. 0.01 feature unit. The selected lines should be what you need.&lt;/P&gt;&lt;P&gt;FYI, in Pro 2.9, the Split Line At Vertices tool writes out the following fields in the output feature class:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;ORIG_FID&lt;/SPAN&gt;—Stores the feature IDs of the input features.&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;ORIG_SEQ&lt;/SPAN&gt;—Stores the sequence number for each output line following the order of the segments from the starting vertex of the input feature.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;As a result, you only need to run this tool and then select "ORIG_SEQ = 1" to get the starting segments.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/split-line-at-vertices.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/split-line-at-vertices.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 05:50:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-first-segment-of-polylines/m-p/1183013#M56197</guid>
      <dc:creator>DanLee</dc:creator>
      <dc:date>2022-06-15T05:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extract first segment of polylines</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-first-segment-of-polylines/m-p/1183021#M56202</link>
      <description>&lt;P&gt;perhaps&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/multipart-to-singlepart.htm" target="_blank" rel="noopener"&gt;Multipart To Singlepart (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;if the polyline isn't just a polyline with segments.&lt;/P&gt;&lt;P&gt;then&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/delete-identical.htm" target="_blank" rel="noopener"&gt;Delete Identical (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;on the&amp;nbsp;ORIG_FID &lt;SPAN class=""&gt;in the output, assuming that the first part of the multipart is retained.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This should only work if your multipart polyline is constructed of 2 point segments&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 06:39:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-first-segment-of-polylines/m-p/1183021#M56202</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-06-15T06:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extract first segment of polylines</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/extract-first-segment-of-polylines/m-p/1183042#M56206</link>
      <description>&lt;UL&gt;&lt;LI&gt;copy your feature class&lt;/LI&gt;&lt;LI&gt;run the script below (change path to the copy)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.UpdateCursor("fc_path_or_layer_name", ["SHAPE@"]) as cursor:
    for shp, in cursor:
        new_path = shp[0][:2]  # first part, first and second vertex
        new_shp = arcpy.Polyline(new_path, spatial_reference=shp.spatialReference)
        cursor.updateRow([new_shp])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1655282142907.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43507i58CD56DC062D721B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1655282142907.png" alt="JohannesLindner_0-1655282142907.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1655282315693.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43508i1DBFCA223B37AFBA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1655282315693.png" alt="JohannesLindner_1-1655282315693.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 08:55:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/extract-first-segment-of-polylines/m-p/1183042#M56206</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-06-15T08:55:20Z</dc:date>
    </item>
  </channel>
</rss>

