<?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: Attribute rule - example with Within function in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583968#M25728</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for all these helpful links. It's a pity that there's no beginners course on Arcade yet, but hopefully I will be able to get started with the help of these resources and a bit of trial and error. If I don't succeed, I would be very happy to get some help with a few test expressions. But I will give it a try first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Aug 2019 14:55:48 GMT</pubDate>
    <dc:creator>ElinS</dc:creator>
    <dc:date>2019-08-07T14:55:48Z</dc:date>
    <item>
      <title>Attribute rule - example with Within function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583964#M25724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;I have been working with the Data reviewer in ArcMap and am now exploring the Data reviewer and Attribute rules in Pro. Currently, I am trying to create a few constraint type attribute rules with Arcade, but for some rules I have not been able to get the right result. I don't have any scripting experience, so working with the Arcade expressions is still a bit of a challenge for me. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;I would like to create a rule for a line feature class (FC1) stating that this line (except for lines of type 1) should always be on top of a line from another feature class (FC2). I have been able to create a rule with the Intersects function, but of course this rule still approves lines from FC1 that only cross or partly intersect lines from FC2. This is the rule I created:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;var FC2 = FeatureSetByName($datastore, "FC2",["objectid"], true);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;var int = Intersects(FC2, Geometry($feature));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;if (First(int) == null &amp;amp;&amp;amp; $feature.FC1TYPE != 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt; return false; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;else&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt; return true;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;Now I would like to replace the Intersects function with a Within function, but I don't know how to do this. I have tried several options, but none of them seem to work properly. In most cases all edits/inserts are seen as actions that are violating the rule. It probably has something to do with the output of the function, either being featureset or a boolean. It's not yet clear to me when the geometry functions return a boolean or a featureset. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;I know there are also a few ready-to-use rules which don't require custom Arcade expressions, but I would like to learn how to create these expressions. I have also looked at several examples of Attribute rules, but I find it difficult to translate these to my situation. Most of the examples are still a bit too complicated for me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;Can someone show me how I can recreate this rule with a Within function?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;Thank you very much! &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2019 07:58:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583964#M25724</guid>
      <dc:creator>ElinS</dc:creator>
      <dc:date>2019-08-05T07:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule - example with Within function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583965#M25725</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/363380"&gt;Elin S&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interesting use case. Can yo explain a little more about why a line has to coincide with lines from another featureclass?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A couple of notes on how you might want to do this and if you really should be doing this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;First of all, avoid doing intersects and retrieving data when it is not necessary. So first check the FC1TYPE and only do the rest when it is not type 1&lt;/LI&gt;&lt;LI&gt;The Within function takes an inside and outside geometry, The outside geometry should be a polygon in order to contain the inside geometry that you are testing. To create this outside geometry you&amp;nbsp;could use a buffer with a small tolerance. You cannot buffer a feature set, but you can buffer individual features. So, you would probably end up doing an intersect, then loop over the individual features and buffer them, then create a union of the buffered features and test against that feature in the Within function.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Looking at the number of processes involved in the description above, this might have a huge impact on performance.&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2019 12:18:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583965#M25725</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-08-05T12:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule - example with Within function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583966#M25726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;Hi Xander,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt; "&gt;Thank you very much for your help. I am new to this all, so the rules I am creating now are just to get an idea of what is possible and to get more acquainted with Arcade. I can understand that one might want to be careful with the number of geometry-on-geometry constraint type rules, in order to keep a good performance. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;The case I am working with involves culverts and waterways. The culverts (&amp;lt;&amp;gt; type 1) should coincide with waterways. In the Datareviewer in Arcmap I used the geometry on geometry check (spatial relation type: Within, ) to identify features that are not in that relationship. I am now trying to&amp;nbsp;redo this check&amp;nbsp;as a constraint attribute rule. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;What do you think would be the best approach for this situation? &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;I have seen some examples in UC videos, but I still find it difficult to translate these to my own situation. Do you know if there is going be some kind of Arcade course&amp;nbsp;for beginners on the Esri academy?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt; "&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="font-size: 11pt;"&gt;Thank you so much!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2019 11:42:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583966#M25726</guid>
      <dc:creator>ElinS</dc:creator>
      <dc:date>2019-08-06T11:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule - example with Within function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583967#M25727</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/363380"&gt;Elin S&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I know, there isn't a course on Arcade (yet). However, there are quite a number of resources available. Apart from the official documentation:&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade"&gt;https://developers.arcgis.com/arcade&lt;/A&gt;&amp;nbsp;and the repository on GitHub:&amp;nbsp;&lt;A href="https://github.com/Esri/arcade-expressions"&gt;https://github.com/Esri/arcade-expressions&lt;/A&gt;&amp;nbsp;there have been a number of&amp;nbsp;blog posts with examples.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Especially interesting are the explanations on FeatureSets in blog post written by Paul Barker:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/mapping/mapping/whats-new-with-arcade-taking-a-stroll-through-featuresets-part-1/"&gt;https://www.esri.com/arcgis-blog/products/mapping/mapping/whats-new-with-arcade-taking-a-stroll-through-featuresets-part-1/&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/mapping/mapping/whats-new-with-arcade-taking-a-stroll-through-featuresets-part-2/"&gt;https://www.esri.com/arcgis-blog/products/mapping/mapping/whats-new-with-arcade-taking-a-stroll-through-featuresets-part-2/&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also &lt;A href="https://community.esri.com/migrated-users/3063"&gt;Kelly Gerrow&lt;/A&gt;‌ wrote an interesting blog on working with overlapping feature in Arcade:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A _jive_internal="true" href="https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2018/12/10/overlapping-features-in-pop-ups-quick-introduction-to-using-featuresets-with-arcade"&gt;https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2018/12/10/overlapping-features-in-pop-ups-quick-introduction-to-using-featuresets-with-arcade&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a post here where I&amp;nbsp;use FeatureSetBy functions to drill down layers:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-12773-using-featuresetby-functions-in-arcade-to-drill-down-to-other-layers-and-tables"&gt;https://community.esri.com/docs/DOC-12773-using-featuresetby-functions-in-arcade-to-drill-down-to-other-layers-and-tables&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you are interested in using&amp;nbsp;attribute rules, here are a couple of interesting things you may want to read:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;This video on YouTube is a nice presentation on Attribute Rules:&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=-2W1H0xr90o"&gt;https://www.youtube.com/watch?v=-2W1H0xr90o&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://www.linkedin.com/pulse/automating-calculations-constraints-attribute-rules-tom-coolidge"&gt;https://www.linkedin.com/pulse/automating-calculations-constraints-attribute-rules-tom-coolidge&lt;/A&gt;&amp;nbsp;(LinkedIn article written by Tom Coolidge)&lt;/LI&gt;&lt;LI&gt;Tom DeWitte has a couple of blog posts here&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/people/tdewitte-esristaff/blog"&gt;https://community.esri.com/people/tdewitte-esristaff/blog&lt;/A&gt;&amp;nbsp;which are very interesting too.&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/attribute-rules-whats-new-in-arcgis-pro-2-3-and-arcgis-enterprise-10-7/"&gt;https://www.esri.com/arcgis-blog/products/arcgis-pro/data-management/attribute-rules-whats-new-in-arcgis-pro-2-3-and-arcgis-enterprise-10-7/&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could set up some test Arcade expressions, but that would require access to a small sample of your data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2019 13:24:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583967#M25727</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-08-06T13:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule - example with Within function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583968#M25728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for all these helpful links. It's a pity that there's no beginners course on Arcade yet, but hopefully I will be able to get started with the help of these resources and a bit of trial and error. If I don't succeed, I would be very happy to get some help with a few test expressions. But I will give it a try first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Aug 2019 14:55:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583968#M25728</guid>
      <dc:creator>ElinS</dc:creator>
      <dc:date>2019-08-07T14:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rule - example with Within function</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583969#M25729</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/Djurra"&gt;Djurra&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just post back when you need more help.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Aug 2019 13:05:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-example-with-within-function/m-p/583969#M25729</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-08-08T13:05:34Z</dc:date>
    </item>
  </channel>
</rss>

