<?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>idea Combine Multiple Attribute Intersects in one Rule in Attribute Rules Ideas</title>
    <link>https://community.esri.com/t5/attribute-rules-ideas/combine-multiple-attribute-intersects-in-one-rule/idi-p/1014682</link>
    <description>&lt;P&gt;Combining multiple intersect rules into one rule. I have three different point layers for our Stormwater Infrastructure. I have a single line layer that I am writing the rule in. Below is the code I wrote to try to update a field based on intersect and it does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;//The attribute rule is setup to pull a field value from a 'upstream' layer.&amp;nbsp;&lt;BR /&gt;//This generates the geometry of the line layer&amp;nbsp;&lt;BR /&gt;Var g = Geometry($feature);&amp;nbsp;&lt;BR /&gt;//The variable generates the start point of the line&amp;nbsp;&lt;BR /&gt;Var toPointGeom = g.paths[0][0];&amp;nbsp;&lt;BR /&gt;//The variable calls out the point layer and a specific field with no need to return&amp;nbsp;&lt;BR /&gt;Var fsPoint =FeatureSetByName($datastore, "GISProduction_10_7_1.SDE.D_Aprons",['FACILITYID']);&amp;nbsp;&lt;BR /&gt;Var fsPoint2 =FeatureSetByName($datastore, "GISProduction_10_7_1.SDE.D_Manholes", ['FACILITYID']);&amp;nbsp;&lt;BR /&gt;Var fsPoint3 =FeatureSetByName($datastore, "GISProduction_10_7_1.SDE.D_Control_Structure", ['FACILITYID'])&lt;BR /&gt;//Selects the first line endpoint that intersects the point&amp;nbsp;&lt;BR /&gt;Var toPoint = (Intersects(fsPoint , toPointGeom) )&amp;nbsp;&lt;BR /&gt;Var toPoint2 = (Intersects(fsPoint2 ,toPointGeom) )&amp;nbsp;&lt;BR /&gt;Var toPoint3 = (Intersects(fsPoint3 ,toPointGeom) )&amp;nbsp;&lt;BR /&gt;//The script reads if the Intersect return value is null show '-1', otherwise return the toPoint fsPoint FacilityID&amp;nbsp;&lt;BR /&gt;If(toPoint &amp;gt; null){&lt;BR /&gt;return toPoint.FACILITYID}&lt;BR /&gt;else if (toPoint == null &amp;amp;&amp;amp; toPoint2 &amp;gt; null){&lt;BR /&gt;return toPoint2.FACILITYID}&lt;BR /&gt;else if (toPoint == null &amp;amp;&amp;amp; toPoint2 == null &amp;amp;&amp;amp; toPoint3 &amp;gt; null){&lt;BR /&gt;return toPoint3.FACILITYID}&lt;/P&gt;&lt;P&gt;else{&lt;/P&gt;&lt;P&gt;return -1}&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jan 2021 16:27:14 GMT</pubDate>
    <dc:creator>sjet1010</dc:creator>
    <dc:date>2021-01-07T16:27:14Z</dc:date>
    <item>
      <title>Combine Multiple Attribute Intersects in one Rule</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/combine-multiple-attribute-intersects-in-one-rule/idi-p/1014682</link>
      <description>&lt;P&gt;Combining multiple intersect rules into one rule. I have three different point layers for our Stormwater Infrastructure. I have a single line layer that I am writing the rule in. Below is the code I wrote to try to update a field based on intersect and it does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;//The attribute rule is setup to pull a field value from a 'upstream' layer.&amp;nbsp;&lt;BR /&gt;//This generates the geometry of the line layer&amp;nbsp;&lt;BR /&gt;Var g = Geometry($feature);&amp;nbsp;&lt;BR /&gt;//The variable generates the start point of the line&amp;nbsp;&lt;BR /&gt;Var toPointGeom = g.paths[0][0];&amp;nbsp;&lt;BR /&gt;//The variable calls out the point layer and a specific field with no need to return&amp;nbsp;&lt;BR /&gt;Var fsPoint =FeatureSetByName($datastore, "GISProduction_10_7_1.SDE.D_Aprons",['FACILITYID']);&amp;nbsp;&lt;BR /&gt;Var fsPoint2 =FeatureSetByName($datastore, "GISProduction_10_7_1.SDE.D_Manholes", ['FACILITYID']);&amp;nbsp;&lt;BR /&gt;Var fsPoint3 =FeatureSetByName($datastore, "GISProduction_10_7_1.SDE.D_Control_Structure", ['FACILITYID'])&lt;BR /&gt;//Selects the first line endpoint that intersects the point&amp;nbsp;&lt;BR /&gt;Var toPoint = (Intersects(fsPoint , toPointGeom) )&amp;nbsp;&lt;BR /&gt;Var toPoint2 = (Intersects(fsPoint2 ,toPointGeom) )&amp;nbsp;&lt;BR /&gt;Var toPoint3 = (Intersects(fsPoint3 ,toPointGeom) )&amp;nbsp;&lt;BR /&gt;//The script reads if the Intersect return value is null show '-1', otherwise return the toPoint fsPoint FacilityID&amp;nbsp;&lt;BR /&gt;If(toPoint &amp;gt; null){&lt;BR /&gt;return toPoint.FACILITYID}&lt;BR /&gt;else if (toPoint == null &amp;amp;&amp;amp; toPoint2 &amp;gt; null){&lt;BR /&gt;return toPoint2.FACILITYID}&lt;BR /&gt;else if (toPoint == null &amp;amp;&amp;amp; toPoint2 == null &amp;amp;&amp;amp; toPoint3 &amp;gt; null){&lt;BR /&gt;return toPoint3.FACILITYID}&lt;/P&gt;&lt;P&gt;else{&lt;/P&gt;&lt;P&gt;return -1}&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 16:27:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/combine-multiple-attribute-intersects-in-one-rule/idi-p/1014682</guid>
      <dc:creator>sjet1010</dc:creator>
      <dc:date>2021-01-07T16:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Combine Multiple Attribute Intersects in one Rule</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/combine-multiple-attribute-intersects-in-one-rule/idc-p/1077955#M18</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/435037"&gt;@sjet1010&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also had been trying to combine all of these intersects into one attribute rule for our stormwater dataset but was unsuccessful in making one rule. Instead I had to make six separate rules for my intersecting features (storm manhole, inlet, and Intake / Outfall points). Three for the "FromPoint" rules and three for the "ToPoint" Rules. Below are examples for the attribute rules just for to and from manholes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;From Manhole Attribute Rule:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;var g = Geometry($feature);

var fromPointGeometry = g.paths[0][0];

var stMH =FeatureSetByName($datastore, "stManhole", ["FACILITYID"], false);

var fromPoint = First(Intersects(stMH, fromPointGeometry )  )

if (fromPoint != null){

return fromPoint.FACILITYID;

} else {

// do nothing
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;To Manhole Attribute Rule:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;var g = Geometry($feature);

var toPointGeometry = g.paths[-1][-1];

var stMH =FeatureSetByName($datastore, "stManhole", ["FACILITYID"], false);

var toPoint = First(Intersects(stMH, toPointGeometry )  )

if (toPoint != null){

return toPoint.FACILITYID;

} else {

// do nothing
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was the order of the attribute rules I used:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. From Manhole&lt;/P&gt;&lt;P&gt;2. From Inlet&lt;/P&gt;&lt;P&gt;3. From Intake / Outfall&lt;/P&gt;&lt;P&gt;4. To Manhole&lt;/P&gt;&lt;P&gt;5. To Inlet&lt;/P&gt;&lt;P&gt;6. To Intake / Outfall&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps some!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 18:34:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/combine-multiple-attribute-intersects-in-one-rule/idc-p/1077955#M18</guid>
      <dc:creator>GISUSER6</dc:creator>
      <dc:date>2021-07-12T18:34:47Z</dc:date>
    </item>
  </channel>
</rss>

