Hi everybody,
I am currently working on a problem related to arc arcade, arc pro. Basically I am trying to create an attribute rule that checks if a created feature intersects with any endpoint of a featureset of polylines. For this to work I created this code:
for(var line in lines){
var endPoint = Geometry(line).paths[-1][-1]
return count(intersects(endPoint, Geometry($feature))) > 0
}
This should return "False" if the created feature is not intersecting one of the line endpoints im trying to iterate over. However all I get is a "unexpected null" error at "var endPoint". Any Ideas how i could solve the problem and get the end points of all the line features im iterating over?
Thanks.
Stefan
Solved! Go to Solution.
// get all intersecting lines
var lines = FeaturesetByName($datastore, "TestLines")
var i_lines = Intersects(lines $feature)
// loop thorugh those lines, return true if any end point intersects $feature
for(var line in i_lines) {
var end_point = Geometry(line).paths[-1][-1]
if(Intersects(end_point, $feature)) {
return true
}
}
// no end point intersects $feature
return false
// get all intersecting lines
var lines = FeaturesetByName($datastore, "TestLines")
var i_lines = Intersects(lines $feature)
// loop thorugh those lines, return true if any end point intersects $feature
for(var line in i_lines) {
var end_point = Geometry(line).paths[-1][-1]
if(Intersects(end_point, $feature)) {
return true
}
}
// no end point intersects $feature
return false
Your solution workes just perfect. Thank you so much for the help!