<?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 within() function; points within polygon in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1529772#M87675</link>
    <description>&lt;P&gt;Not sure which environment you're using, but a common pitfall of Arcade's geometry functions is that they evaluate at your current scale, which means things will return different values depending on where you're zoomed.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#within" target="_blank" rel="noopener"&gt;Geometry functions | ArcGIS Arcade | Esri Developer&lt;/A&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;EM&gt;Feature geometries in the visualization and labeling profiles are generalized according to the view's scale resolution to improve drawing performance. Therefore, using a feature's geometry (i.e.$feature) as input to any geometry function in these contexts will return different results at each scale level. Other profiles, such as popup, provide the full resolution geometry.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I think that's probably what's going on. You might have better luck calculating a field with that expression and using that for your popup or whatever? I'm not sure which scale is used to evaluate field calculations, but you should experiment and let me know.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2024 20:02:15 GMT</pubDate>
    <dc:creator>AlfredBaldenweck</dc:creator>
    <dc:date>2024-08-29T20:02:15Z</dc:date>
    <item>
      <title>Arcade within() function; points within polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1414673#M82314</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have two feature classes, one point feature class, and one polygon feature class.&amp;nbsp; When a point falls within a polygon I would like to symbolize differently than a point that is not within a polygon.&amp;nbsp; Does anyone have an example arcade expression to accomplish this?&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;Tyler&lt;/P&gt;&lt;P&gt;ArcGIS Pro 3.2.0&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 13:05:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1414673#M82314</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-04-24T13:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() function; points within polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1414705#M82315</link>
      <description>&lt;P&gt;So... This is an expression that is actually pretty simple in theory.&lt;/P&gt;&lt;P&gt;This expression works fine for popups.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var wit = FeatureSetByName($datastore, "poly")
var check = (Within($feature, wit))
if (check == true){
    return "Inside"
}
else {
    return "Outside"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem that makes this currently impossible is that $featureset is not available for Symbology or Labeling.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-questions/when-will-arcade-get-more-useful-esp-with/m-p/1223334" target="_blank"&gt;When will Arcade get more useful, esp with Feature... - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Basically, because it's designed to execute on a feature-by-feature basis, a call is made to wherever the data lives for every. single. feature. instead of just loading the featureset into memory or caching it in the map.&lt;/P&gt;&lt;P&gt;To avoid it being super slow, we instead only get to reference featuresets for popups, since you can only Identify a few features at a time. (And this is still really slow: See&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;'s blog post for tips to improve $featureset stuff&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-online-blog/improving-expression-performance-a-custom-function/ba-p/1288785" target="_blank"&gt;Improving Expression Performance: A Custom Functio... - Esri Community&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Long story short&lt;/STRONG&gt;: Should be very easy, is currently impossible due to technical limitations.&lt;/P&gt;&lt;P&gt;As an alternative, if your data lives in an enterprise geodatabase, you could use a query layer or a view to return a computed column detailing if the points are "within" and then symbolize off of that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 13:41:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1414705#M82315</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2024-04-24T13:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() function; points within polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1414897#M82338</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/458875"&gt;@AlfredBaldenweck&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Interesting.&amp;nbsp; I guess that might explain why I was getting errors with my Arcade attempts.&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;Tyler&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 17:59:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1414897#M82338</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-04-24T17:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() function; points within polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1529761#M87673</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/458875"&gt;@AlfredBaldenweck&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I took your expression and updated for my map. I am trying to determine if an address point is within the city boundary or outside. The expression works, but I am only getting outside even if the address is within the polygon (city boundary). I am using this expression below on my address point layer. Do you have any pointers for this expression?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;city&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"City_Boundary"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;check&lt;/SPAN&gt;&lt;SPAN&gt; = (&lt;/SPAN&gt;&lt;SPAN&gt;Within&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;city&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;check&lt;/SPAN&gt;&lt;SPAN&gt; == &lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;"Inside"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;"Outside"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Aug 2024 19:50:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1529761#M87673</guid>
      <dc:creator>Kohl_Haessly</dc:creator>
      <dc:date>2024-08-29T19:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() function; points within polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1529772#M87675</link>
      <description>&lt;P&gt;Not sure which environment you're using, but a common pitfall of Arcade's geometry functions is that they evaluate at your current scale, which means things will return different values depending on where you're zoomed.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#within" target="_blank" rel="noopener"&gt;Geometry functions | ArcGIS Arcade | Esri Developer&lt;/A&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;EM&gt;Feature geometries in the visualization and labeling profiles are generalized according to the view's scale resolution to improve drawing performance. Therefore, using a feature's geometry (i.e.$feature) as input to any geometry function in these contexts will return different results at each scale level. Other profiles, such as popup, provide the full resolution geometry.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I think that's probably what's going on. You might have better luck calculating a field with that expression and using that for your popup or whatever? I'm not sure which scale is used to evaluate field calculations, but you should experiment and let me know.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 20:02:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1529772#M87675</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2024-08-29T20:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() function; points within polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1529778#M87676</link>
      <description>&lt;P&gt;Thank you for the response. I am using ArcGIS Online and I am trying to use this just in a Pop up. No matter where I am zoomed it only displays Outside.&amp;nbsp; I will review the Geometry Functions page. Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 20:10:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1529778#M87676</guid>
      <dc:creator>Kohl_Haessly</dc:creator>
      <dc:date>2024-08-29T20:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() function; points within polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1529789#M87677</link>
      <description>&lt;P&gt;Update I got it to work. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 20:27:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1529789#M87677</guid>
      <dc:creator>Kohl_Haessly</dc:creator>
      <dc:date>2024-08-29T20:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() function; points within polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1551473#M89431</link>
      <description>&lt;P&gt;Hi, could you post what you did to your expression to get it to work?&amp;nbsp; I am having the same issue.&lt;/P&gt;&lt;P&gt;I click a polygon in my map and in the popup run this expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;check&lt;/SPAN&gt;&lt;SPAN&gt; = (&lt;/SPAN&gt;&lt;SPAN&gt;Within&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'General Election Polling Sites'&lt;/SPAN&gt;&lt;SPAN&gt;,[&lt;/SPAN&gt;&lt;SPAN&gt;'*'&lt;/SPAN&gt;&lt;SPAN&gt;], &lt;/SPAN&gt;&lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;check&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;This returns an empty featureset.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Oct 2024 17:58:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-within-function-points-within-polygon/m-p/1551473#M89431</guid>
      <dc:creator>KGalluccio</dc:creator>
      <dc:date>2024-10-23T17:58:43Z</dc:date>
    </item>
  </channel>
</rss>

