<?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: Intersection of point, polyline &amp; polygon with Arcade in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/intersection-of-point-polyline-polygon-with-arcade/m-p/190824#M9372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/Fallling"&gt;Fallling&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're welcome, I'm glad it works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 Mar 2020 22:33:26 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2020-03-01T22:33:26Z</dc:date>
    <item>
      <title>Intersection of point, polyline &amp; polygon with Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/intersection-of-point-polyline-polygon-with-arcade/m-p/190821#M9369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having trouble finding the 3-way intersection of a point, polyline, and polygon. I have 3 feature layers with each containing one of the geometries. When a polygon is selected, I'm trying count the intersection of the point with polylines that are in the polygon boundaries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can find the intersection of polygon with point and polygon with polyline, but can't seem to figure out how to then find the point/polyline intersection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My thought process has been:&lt;/P&gt;&lt;P&gt;- Create 2 feature sets from the point feature layer and polyline feature layer&lt;/P&gt;&lt;P&gt;- Find intersection of those feature sets with the polygon&lt;/P&gt;&lt;P&gt;- Loop through the point feature set, explicitly make a point geometry from the feature, add buffer to the geometry,&amp;nbsp; test for intersection with the polyline feature set, and increment a counter if intersects returns true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initially, I wasn't explicitly creating a point geometry from the feature as from my understanding of the arcade documentation, the intersects function should take a feature or geometry as a parameter along with a feature set. However, since that wasn't working, I tried to create the point geometry to see if that would resolve the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This isn't yielding any results, and I'm at loss now. I also tried doing this the reverse way of looping through the polyline feature set and checking for intersection with the point feature set though that also wasn't working (and didn't make as much sense).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be very much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arcade Script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//create feature sets from 2 layers&lt;/P&gt;&lt;P&gt;var accidentFeatureSet = FeatureSetByName($map,"Bicycle Accidents 2012 - 2018");&lt;BR /&gt; var bikewayFeatureSet = FeatureSetByName($map, "Bikeways");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//accidents feature set that intersects with the polygon ($feature)&lt;/P&gt;&lt;P&gt;var accidents = Intersects(&lt;BR /&gt; $feature,&lt;BR /&gt; accidentFeatureSet&lt;BR /&gt; );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//bikeway features set that intersects with the polygon &lt;SPAN&gt;($feature)&lt;/SPAN&gt;&lt;BR /&gt; var bikeways = Intersects(&lt;BR /&gt; $feature,&lt;BR /&gt; bikewayFeatureSet&lt;BR /&gt; );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var accidentOnBikewayCount = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//loop through accidents feature set&lt;/P&gt;&lt;P&gt;//create point geometry for each accident feature and add buffer&lt;/P&gt;&lt;P&gt;//perform intersection of the accident geometry with bikeway feature set&amp;nbsp;&lt;/P&gt;&lt;P&gt;//if intersects == true, increase count&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; for(var feature in accidents){&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var geom = Point(Geometry(feature));&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var buffer = BufferGeodetic(geom, 10, 'feet');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(Intersects(bikeways,buffer) == true)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN&gt;accidentOnBikewayCount&lt;/SPAN&gt; ++;&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2020 02:13:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/intersection-of-point-polyline-polygon-with-arcade/m-p/190821#M9369</guid>
      <dc:creator>haleygray</dc:creator>
      <dc:date>2020-02-27T02:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of point, polyline &amp; polygon with Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/intersection-of-point-polyline-polygon-with-arcade/m-p/190822#M9370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/381048" target="_blank"&gt;haley gray&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the code below:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;//create feature sets from 2 layers&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; accidentFeatureSet &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$map&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Bicycle Accidents 2012 - 2018"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; bikewayFeatureSet &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$map&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Bikeways"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;//accidents feature set that intersects with the polygon ($feature)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// first parameter: Geometry / Feature / FeatureSet&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// second parameter: Geometry / Feature (Note: no FeatureSet!)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; accidents &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Intersects&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;accidentFeatureSet&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;//bikeway features set that intersects with the polygon ($feature)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; bikeways &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Intersects&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;bikewayFeatureSet&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;//loop through accidents feature set&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//create point geometry for each accident feature and add buffer&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//perform intersection of the accident geometry with bikeway feature set &lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//if intersects == true, increase count&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Don't use "feature" and/or "buffer", since thse are a reserved words in Arcade&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; accidentOnBikewayCount &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; f &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; accidents&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; buf &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;BufferGeodetic&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;f&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'feet'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Intersects&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;bikeways&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; buf&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;// bikeway near accident point (&amp;lt;= 10 feet)&lt;/SPAN&gt;
        accidentOnBikewayCount &lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; accidentOnBikewayCount&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A couple of comments on your expression:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The Intersects function does not take a FeatureSet as second argument. The Featureset should be specified as first argument (see lines 8 and 11)&lt;/LI&gt;&lt;LI&gt;Don't use "feature" and "buffer" as variable names since these are reserved names in Arcade (see line 19, 20 and 21)&lt;/LI&gt;&lt;LI&gt;return the result at the end of the expression&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:36:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/intersection-of-point-polyline-polygon-with-arcade/m-p/190822#M9370</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T09:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of point, polyline &amp; polygon with Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/intersection-of-point-polyline-polygon-with-arcade/m-p/190823#M9371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beautiful. Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Mar 2020 21:29:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/intersection-of-point-polyline-polygon-with-arcade/m-p/190823#M9371</guid>
      <dc:creator>haleygray</dc:creator>
      <dc:date>2020-03-01T21:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Intersection of point, polyline &amp; polygon with Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/intersection-of-point-polyline-polygon-with-arcade/m-p/190824#M9372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/Fallling"&gt;Fallling&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You're welcome, I'm glad it works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Mar 2020 22:33:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/intersection-of-point-polyline-polygon-with-arcade/m-p/190824#M9372</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-03-01T22:33:26Z</dc:date>
    </item>
  </channel>
</rss>

