1

I want to use attribute rules to transfer an attribute from lines to points based on which end of the line a point intersects.

I have a set of Flow Meter Points that intersect Pipe Lines.

They are digitized such that the first vertex in each line is the "upstream" end and the last vertex is the "downstream" end.

A given Flow Meter always intersects both a downstream end of a pipe and an upstream end of a pipe

I wish to get the incoming and outgoing diameter from the pipes to the meters.

The end vertex of a pipe that intersects a meter represents the incoming pipe diameter.

the start vertex of a pipe that intersects a meter represents the outgoing pipe diameter.

I have previously worked out how to transfer attributes from a point (manhole) to a line (pipe) as follows:

var g = Geometry($feature);    
var ToDMHPointGeometry = g.paths[-1][-1];    
var fsDMHPoint =FeatureSetByName($datastore, "Drainage_Manholes", ["out_invert"], false);    
var ToDMHPoint = First(Intersects(fsDMHPoint, ToDMHPointGeometry )  )     
if (ToDMHPoint != null) return ToDMHPoint.out_invert;

The reverse - lines to points - is eluding me given that I need to test for the end of the line which intersects the Flow Meter Point.

1 Answer 1

0

I had the same question, this is what is working for me. If you found a solution, would love to know what worked for you if different.

End Vertex

// get all intersecting lines
var lines = FeaturesetByName($datastore, "Stormwater_Pipe")
var i_lines = Intersects(lines, $feature)

// loop thorugh those lines, return true if any end point intersects $feature
var values = Array(0)
for(var line in i_lines) {
    var end_point = Geometry(line).paths[-1][-1]
    if(Intersects(end_point, $feature)) {
            Push(values, line["Diameter"])
    }
}
return Max(values)

Start Vertex

// get all intersecting lines
var lines = FeaturesetByName($datastore, "Stormwater_Pipe")
var i_lines = Intersects(lines, $feature)

// loop thorugh those lines, return true if any end point intersects $feature
var values = Array(0)
for(var line in i_lines) {
    var end_point = Geometry(line).paths[0][0]
    if(Intersects(end_point, $feature)) {
            Push(values, line["Diameter"])
    }
}
return Max(values)

Referenced a few different posts, this one helped the most https://community.esri.com/t5/arcgis-pro-questions/pull-data-from-sewer-line-feature-to-manhole-point/td-p/1084413 https://community.esri.com/t5/arcgis-pro-questions/arcade-error-dictionary-type-expected/td-p/79744

Also additional utility related arcade expressions here https://github.com/Esri/arcade-expressions/blob/1df916dda1ba99cc6ef43345287d63348486b5de/attribute_rule_calculation/RotateFeatureByIntersectedLine.md

Not the answer you're looking for? Browse other questions tagged or ask your own question.