<?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 Spatial Join to a polyon with multiple lines in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-to-a-polyon-with-multiple-lines/m-p/1005005#M24901</link>
    <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;I have polygons that contain multiple lines (Screenshot). How can I make a spatial join to the polygons so that it takes the attributes from the line that is longest in the polygon.&lt;/P&gt;&lt;P&gt;When I select the match option Intersect, it randomly choses a Line. I have also tried other options but so far I haven't found one that gives me the desired result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&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="Screenshot 2020-11-26 132437.jpg" style="width: 436px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/1055i8E82BFAF4772828F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2020-11-26 132437.jpg" alt="Screenshot 2020-11-26 132437.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Nov 2020 12:37:56 GMT</pubDate>
    <dc:creator>NoahLeimgruber</dc:creator>
    <dc:date>2020-11-26T12:37:56Z</dc:date>
    <item>
      <title>Spatial Join to a polyon with multiple lines</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-to-a-polyon-with-multiple-lines/m-p/1005005#M24901</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;I have polygons that contain multiple lines (Screenshot). How can I make a spatial join to the polygons so that it takes the attributes from the line that is longest in the polygon.&lt;/P&gt;&lt;P&gt;When I select the match option Intersect, it randomly choses a Line. I have also tried other options but so far I haven't found one that gives me the desired result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&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="Screenshot 2020-11-26 132437.jpg" style="width: 436px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/1055i8E82BFAF4772828F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2020-11-26 132437.jpg" alt="Screenshot 2020-11-26 132437.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 12:37:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-to-a-polyon-with-multiple-lines/m-p/1005005#M24901</guid>
      <dc:creator>NoahLeimgruber</dc:creator>
      <dc:date>2020-11-26T12:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join to a polyon with multiple lines</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-to-a-polyon-with-multiple-lines/m-p/1005008#M24902</link>
      <description>&lt;P&gt;You can add the attributes of all intersecting lines to your polygon in the field mapping options of the spatial join.&lt;/P&gt;&lt;P&gt;psb excellent article on it.&lt;/P&gt;&lt;P&gt;&lt;A href="https://esriaustraliatechblog.wordpress.com/2015/06/22/spatial-joins-hidden-trick-or-how-to-transfer-attribute-values-in-a-one-to-many-relationship/" target="_blank" rel="noopener"&gt;Spatial Join’s hidden trick or how to transfer attribute values in a One to Many relationship | Esri Australia Technical Blog (wordpress.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you could of course script it, but I'd just to the spatial join, appending all the SHAPE_LENGTH s to a delimited field which would look like - 123.45, 45.56, 789.9...&lt;/P&gt;&lt;P&gt;you could then create a new field then do a field calculation, something selecting the largest value from yourfield.split(",")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;edit - just read that you want the longest line WITHIN the polygon, I'd guess you'd have to clip all the lines to all the polygons, then split the lines again by the boundaries of the polygons (run a polygon to line I think for the split) and then do the join.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 12:44:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-to-a-polyon-with-multiple-lines/m-p/1005008#M24902</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-11-26T12:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join to a polyon with multiple lines</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-to-a-polyon-with-multiple-lines/m-p/1005012#M24903</link>
      <description>&lt;P&gt;Thank you for your response!&lt;/P&gt;&lt;P&gt;I guess I expressed myself a bit wrong. The line does not necessarily have to be within the polygon as a whole. The join should simply select the line that interacts the longest with the polygon&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 13:00:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-to-a-polyon-with-multiple-lines/m-p/1005012#M24903</guid>
      <dc:creator>NoahLeimgruber</dc:creator>
      <dc:date>2020-11-26T13:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join to a polyon with multiple lines</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-to-a-polyon-with-multiple-lines/m-p/1005013#M24904</link>
      <description>&lt;P&gt;Sure, when you find the longest segment of a line within the polygon, it would have coincident geometry with the original line to match it back.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 13:04:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-to-a-polyon-with-multiple-lines/m-p/1005013#M24904</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-11-26T13:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial Join to a polyon with multiple lines</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/spatial-join-to-a-polyon-with-multiple-lines/m-p/1005014#M24905</link>
      <description>&lt;P&gt;You're right. Then I'll try it the way you explained. Thank you very much!&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 13:17:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/spatial-join-to-a-polyon-with-multiple-lines/m-p/1005014#M24905</guid>
      <dc:creator>NoahLeimgruber</dc:creator>
      <dc:date>2020-11-26T13:17:23Z</dc:date>
    </item>
  </channel>
</rss>

