Select to view content in your preferred language

How to set a value in an attribute table when a point is put on the map and intersects a line?

48
2
Friday
rsnider43
New Contributor

Hello, I have written a rule that is supposed to set the value in the point attribute table to 100 if it intersects a line. I have written this script so far, but it keeps evaluating to false even if then new point is snapped to a line feature. Any ideas on how to get this to work?

 

var fibercable = FeaturesetByName($datastore, "attributeruletest.sde.fibercable", ['*'], true);
if(intersects(Geometry($feature), fibercable) == true)
{
return 100;
} else {
return false;
}

0 Kudos
2 Replies
MikeMillerGIS
Esri Frequent Contributor

Your "Intersects" is backwards. 

**EDIT: Also, it returns a featureset, so you need to do a count.  updated the code

 

Also, please post code as a code sample(use javascript for arcade).

var fibercable = FeaturesetByName($datastore,"attributeruletest.sde.fibercable", ['*'], true);
if(Count(intersects(fibercable,Geometry($feature))) > 0)
{
   return 100;
} else {
   return false;
}

 

MikeMillerGIS_0-1749228834118.png

 

0 Kudos