Attribute Rules Intersect

165
6
Jump to solution
2 weeks ago
Highlighted
New Contributor II

Hello @XanderBakker ,

Can I use the attribute rules to intersect two features to update an attribute. If the tracks fc intersect with the line buffer I created I want to update the field in the line buffer to Yes or No to determine if the tracks intersect.

I can get the code to execute in the Calculate Field Tool but cannot get it to work as an attribute rule.

DonovanC_0-1605629591040.png

 

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Esteemed Contributor

Hi @DonovanC ,

 

Not sure what is going wrong. I just did a test changing the attribute of the polygons depending if there are points inside the polygon and it all works as expected.

Arcade expression:

XanderBakker_0-1605724691488.png

 

Capturing a new polygon with a point inside:

XanderBakker_1-1605724840182.png

... automatically gets codes with "Yes" (green):

XanderBakker_2-1605724881447.png

and when creating a polygon that has no point inside:

XanderBakker_3-1605724919852.png

will automatically get the code "No" (red):

XanderBakker_4-1605724955224.png

 

Maybe it is data related. Would it be possible te receive a small sample of the data?

 

View solution in original post

6 Replies
Highlighted
Esri Esteemed Contributor

Hi @DonovanC ,

 

Can you share a screenshot of how you configured the calculation attribute rule?

Reply
0 Kudos
Highlighted
New Contributor II

Hey @XanderBakker 

DonovanC_0-1605709650813.png

This is a screen shot of the tracks that intersect the buffer.

DonovanC_1-1605709779532.png

Here is the code, I used the same script from the field calculator and I thought that it would apply the same as an attribute rule.

 

Thanks Donovan

 

Tags (2)
Highlighted
Esri Esteemed Contributor

Hi @DonovanC ,

 

The first thing to look at would be making sure that your layer has GlobalID's. This is required for an attribute rule to work.

I did a test with some slightly different code and it seems to work:

var fs = FeatureSetByName($datastore, "buffers");
var LeakSurveys = Intersects(fs, $feature);
if (Count(LeakSurveys) > 0) {
   return "Yes";
} else {
   return "No";
}

 

The expression:

XanderBakker_0-1605718401214.png

 

Attribute rule configuration:

XanderBakker_1-1605718423194.png

 

The result symbolized by LeakSurvey (Yes/No):

XanderBakker_2-1605718455995.png

 

Remember to check your GlobalID's:

XanderBakker_3-1605718546032.png

 

 

Reply
0 Kudos
Highlighted
New Contributor II

Hi @XanderBakker 

That's exactly what I want but in my case I want my buffer line to indicate Yes/No if the point falls within the buffer and not the points  showing the indication. The naming convention I created might seem a bit confusing, sorry about that. My fs "Tracks_Buffers" are the points. 

DonovanC_0-1605720450786.png

 

The Polygon with the buffer has Global ID's already.

Tags (2)
Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi @DonovanC ,

 

Not sure what is going wrong. I just did a test changing the attribute of the polygons depending if there are points inside the polygon and it all works as expected.

Arcade expression:

XanderBakker_0-1605724691488.png

 

Capturing a new polygon with a point inside:

XanderBakker_1-1605724840182.png

... automatically gets codes with "Yes" (green):

XanderBakker_2-1605724881447.png

and when creating a polygon that has no point inside:

XanderBakker_3-1605724919852.png

will automatically get the code "No" (red):

XanderBakker_4-1605724955224.png

 

Maybe it is data related. Would it be possible te receive a small sample of the data?

 

View solution in original post

Highlighted
Esri Esteemed Contributor

Hi @DonovanC ,

 

I tried to reply you private message, but I think there is something not working correctly at this moment. I was not able to download the ZIP you shared, since for some reason it end up downloading a download.html page and not the ZIP (weird). Also when I tried to answer with a private message an error occurred. 

 

If possible please send the ZIP to "xbakker[at]esri.co" (and yes ".co" stands for Colombia).

Reply
0 Kudos