<?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: How to generate 'largest overlap' from polygon-in-polygon query in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1284493#M868</link>
    <description>&lt;P&gt;Do you actually use this expression in 2.9?&lt;/P&gt;&lt;P&gt;The expression should work for ArcGIS Pro 2.7+&lt;/P&gt;</description>
    <pubDate>Mon, 01 May 2023 20:08:38 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2023-05-01T20:08:38Z</dc:date>
    <item>
      <title>How to generate 'largest overlap' from polygon-in-polygon query</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1283562#M862</link>
      <description>&lt;P&gt;Hoping the community here can lend a hand.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal: create a calculation attribute rule for a polygon feature class that extracts a value from the feature with which it has the largest overlap in another dataset. If a user creates a polygon I want the value of an underlying polygon to be used for an attribute in the edited datasets. However I want to have error controls in case the user creates a polygon that overlaps two of the underlying polygons. I want to extract the attribute from the polygon with which it has the largest overlap.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var fsJurisdiction = FeatureSetByName($datastore, "jurisdictions", ["Jurisdiction"])

var fsJurisdictionIntersect = Intersects(fsJurisdiction, $feature)
var jurisdiction = First(fsJurisdictionIntersect)

if (jurisdiction == null) return {"errorMessage": "Not in a jurisdiction"}

return jurisdiction.Jurisdiction&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 19:57:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1283562#M862</guid>
      <dc:creator>SFM_TravisBott</dc:creator>
      <dc:date>2023-04-27T19:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate 'largest overlap' from polygon-in-polygon query</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1283704#M864</link>
      <description>&lt;LI-CODE lang="javascript"&gt;var fsJurisdiction = FeatureSetByName($datastore, "jurisdictions", ["Jurisdiction"])

var fsJurisdictionIntersect = Intersects(fsJurisdiction, $feature)
var intersected_jurisdictions = []
for(var j in fsJurisdictionIntersect) {
    var jurisdiction = {
        Jurisdiction: j.Jurisdiction,
        Overlap: Area(Intersection(j, $feature))
    }
    Push(intersected_jurisdictions, jurisdiction)
}
function sort_by_overlap(j1, j2) { return j1.Overlap &amp;lt; j2.Overlap }

var jurisdiction = First(Sort(intersected_jurisdictions, sort_by_overlap))

if (jurisdiction == null) return {"errorMessage": "Not in a jurisdiction"}

return jurisdiction.Jurisdiction&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Apr 2023 05:53:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1283704#M864</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-04-28T05:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate 'largest overlap' from polygon-in-polygon query</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1284093#M866</link>
      <description>&lt;P&gt;Well that worked perfectly. Gold star for&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;. Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 21:18:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1284093#M866</guid>
      <dc:creator>SFM_TravisBott</dc:creator>
      <dc:date>2023-04-28T21:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate 'largest overlap' from polygon-in-polygon query</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1284430#M867</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;I actually wanted to follow up here in case you have additional knowledge - the syntax you gave me works flawlessly in 3.x. However I opened the gdb in 2.9 and it reverts to the same behavior when using First....it stops using largest overlap as you've described.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a known limitation?&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 17:15:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1284430#M867</guid>
      <dc:creator>SFM_TravisBott</dc:creator>
      <dc:date>2023-05-01T17:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate 'largest overlap' from polygon-in-polygon query</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1284493#M868</link>
      <description>&lt;P&gt;Do you actually use this expression in 2.9?&lt;/P&gt;&lt;P&gt;The expression should work for ArcGIS Pro 2.7+&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 20:08:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1284493#M868</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-05-01T20:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate 'largest overlap' from polygon-in-polygon query</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1284544#M869</link>
      <description>&lt;P&gt;I did test it in 2.9&lt;/P&gt;&lt;P&gt;I opened the database I created in 3.1, where the rules executed successfully, in 2.9. The overlap rule no longer works and it takes the first jurisdiction only.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 22:06:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1284544#M869</guid>
      <dc:creator>SFM_TravisBott</dc:creator>
      <dc:date>2023-05-01T22:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate 'largest overlap' from polygon-in-polygon query</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1284604#M871</link>
      <description>&lt;P&gt;Sorry to say that I have no clue.&lt;/P&gt;&lt;P&gt;Try deleting the rule and creating it in 2.9.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 07:38:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/how-to-generate-largest-overlap-from-polygon-in/m-p/1284604#M871</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-05-02T07:38:02Z</dc:date>
    </item>
  </channel>
</rss>

