<?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: Clipping Polyline from Polygon - Geometry in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/clipping-polyline-from-polygon-geometry/m-p/1271359#M8547</link>
    <description>&lt;P&gt;try intersect()&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2023 14:38:11 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2023-03-24T14:38:11Z</dc:date>
    <item>
      <title>Clipping Polyline from Polygon - Geometry</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/clipping-polyline-from-polygon-geometry/m-p/1271340#M8546</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi, I am trying to find the length of polyline in a polygon however clip only accepts envelop (rectangle). what can I do to get the total length of the polyline within a polygon. Thanks in advance.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;track_f&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;track_fset&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;features&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPA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PAN&gt;))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&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="vtey_esriau_0-1679666826199.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66195iC537994C69E0FD84/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vtey_esriau_0-1679666826199.png" alt="vtey_esriau_0-1679666826199.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 14:12:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/clipping-polyline-from-polygon-geometry/m-p/1271340#M8546</guid>
      <dc:creator>vtey_esriau</dc:creator>
      <dc:date>2023-03-24T14:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping Polyline from Polygon - Geometry</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/clipping-polyline-from-polygon-geometry/m-p/1271359#M8547</link>
      <description>&lt;P&gt;try intersect()&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 14:38:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/clipping-polyline-from-polygon-geometry/m-p/1271359#M8547</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2023-03-24T14:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping Polyline from Polygon - Geometry</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/clipping-polyline-from-polygon-geometry/m-p/1271591#M8548</link>
      <description>&lt;P&gt;wow, thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/167692"&gt;@DavidPike&lt;/a&gt;&amp;nbsp;. I simply assumed intersect returns True or False :D. I tested with intersect and it is returning a multipoint. Any advise on how to convert that to a polyline?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 23:44:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/clipping-polyline-from-polygon-geometry/m-p/1271591#M8548</guid>
      <dc:creator>vtey_esriau</dc:creator>
      <dc:date>2023-03-24T23:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping Polyline from Polygon - Geometry</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/clipping-polyline-from-polygon-geometry/m-p/1271593#M8549</link>
      <description>&lt;P&gt;ah glad it may work, I've no experience of doing it however. The documentation also seems a bit arcane.&lt;/P&gt;&lt;P&gt;I'm assuming it's returning a set of points where they intersect?&lt;/P&gt;&lt;P&gt;the doc here suggest a 'dimension' parameter&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/part3-spatial-operations-on-geometries/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/python/guide/part3-spatial-operations-on-geometries/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;so perhaps:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;yourGeometry.intersect(yourOtherGeom, dimension=2)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H4&gt;a4. intersect() V.S. overlaps()&lt;/H4&gt;&lt;P&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;intersect()&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;constructs a geometry that is the geometric intersection of the two input geometries. Different dimension values can be used to create different shape types. The intersection of two geometries of the same shape type is a geometry containing only the regions of overlap between the original geometries, and its arguments include:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;second_geometry: required&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;arcgis.geometry.Geometry.&lt;/LI&gt;&lt;LI&gt;A second geometry&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;dimension: required Integer. The topological dimension (shape type) of the resulting geometry, which can be:&lt;UL&gt;&lt;LI&gt;1: A zero-dimensional geometry (point or multipoint).&lt;/LI&gt;&lt;LI&gt;2: A one-dimensional geometry (polyline).&lt;/LI&gt;&lt;LI&gt;4: A two-dimensional geometry (polygon).&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 00:09:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/clipping-polyline-from-polygon-geometry/m-p/1271593#M8549</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2023-03-25T00:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Clipping Polyline from Polygon - Geometry</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/clipping-polyline-from-polygon-geometry/m-p/1271598#M8550</link>
      <description>&lt;P&gt;thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; that worked. I should really learn to read the documentation.&lt;/P&gt;&lt;P&gt;I was reading -&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.geometry.html#intersect" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.geometry.html#intersect&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 02:10:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/clipping-polyline-from-polygon-geometry/m-p/1271598#M8550</guid>
      <dc:creator>vtey_esriau</dc:creator>
      <dc:date>2023-03-25T02:10:06Z</dc:date>
    </item>
  </channel>
</rss>

