Hello -
I am currently working to migrate our Attribute Assistant, Dynamic Values in ArcMap to Attribute Rules in ArcPro. I found this handy dandy GitHub page, which has been a HUGE help. However the INTERSECTING_FEATURE_DISTANCE rule from Attribute Assistant doesn't appear to have any migration clues...
What I want to do:
I need to find the distance along a pipe where a tap intersects it. This value needs to be returned in feet and added to a field in the Tap feature class table.
I was thinking I could start with the following
//Returns true if the geometries intersect
//Intersects(geometry1, geometry2)
var pipe = Polyline(FeatureSetByName($datastore, "wwMain_TN"));
Intersects($feature, pipe);
This will only give me a true if they intersect. But I need to know at what distance along the pipe that intersection is happening.
I found this post, but I don't want to create new lines or actually split the pipes. I simply want to find where the Taps lands along the pipe...
I also have this that I am using to find the to/from MH at the ends of each pipe, so I am wondering if I could adjust it to my needs?
// This Arcade expression will calculate field values from intersecting point layer.
// Can be used for either the From OR the To Junction Field Attribute Assistant Methods. Will need to comment out/uncomment specfic lines (noted in the code below) depending on what it is being used for.
//FROM MHID
// Get Point layer, with fields to evaluate
var fields = ['FACILITYID']
var point_fs = FeatureSetByName($datastore, "wwManhole_TN", fields, true);
var line_shape = Geometry($feature)
var spRef = line_shape['spatialReference']
// Get the origin and end points of the line
var orig_x = line_shape['paths'][0][0].x
var orig_y = line_shape['paths'][0][0].y
var orig_point = Point({x: orig_x, y: orig_y, spatialReference: spRef})
var end_x = line_shape['paths'][-1][-1].x
var end_y = line_shape['paths'][-1][-1].y
var end_point = Point({x: end_x, y: end_y, spatialReference: spRef})
var attributes = {}
function IsEmptyButBetter(data) {Fea
if (IsEmpty(data)) return true;
for (var x in data) return false;
return true;
}
//comment the following to line 35 if you are using for TOMHID
//find point intersecting origin
var origIntx = first(Intersects(orig_point, point_fs));
if (!IsEmptyButBetter(origIntx)) {
// attributes['UPELEV'] = origIntx['ELEV']
attributes['FROMMH'] = origIntx['FACILITYID']
}
//uncomment the following to line 43 if you are using for TOMHID
////find point intersecting end
//var endIntx = first(Intersects(end_point, point_fs));
//
//if (!IsEmptyButBetter(endIntx)) {
// // attributes['DOWNELEV'] = endIntx['ELEV']
// attributes['TOMH'] = endIntx['FACILITYID']
// }
var result = {}
if (!IsEmptyButBetter(attributes)) {
result['result'] = {
'attributes': attributes
}
}
return result
Has anyone done this before and have any words of wisdom?!
Thanks in advance!
Vanessa-