FROM and TO information for line segment

863
6
03-15-2022 05:30 PM
Labels (2)
aam
by
Occasional Contributor

What is the best way to get FROM and TO information for each line segment. I need this for the roads network.

6 Replies
DanPatterson
MVP Esteemed Contributor

Calculate Geometry Attributes (Data Management)—ArcGIS Pro | Documentation

using LINE_START_X, ...Y etc

This will return the line segment start and end coordinates.  If you want it for each segment within a polyline, then Split Line At Vertices (Data Management)—ArcGIS Pro | Documentation

or more simply, just use Feature Vertices To Points (Data Management)—ArcGIS Pro | Documentation

then use the Calculate geometry to get the coordinate values.


... sort of retired...
0 Kudos
SarahHartholt
Occasional Contributor III

is there a way to populate the To/From info with an intersecting road name? i.e. If Main St. starts at First Ave. and ends at Fifth Ave. I would like the From value to be First Ave. and the To value to be Fifth Ave.

0 Kudos
aam
by
Occasional Contributor

A bit of a process but nevertheless it works.

• Use Feature to Vertices twice – first to place a point for the START and then for the END. At this point you should have two separate feature classes.

• Use INTERSECT to intersect each of the above two feature classes with the Roads feature class. You will have two new fcs (STARTS_INTERSECT and END_INTERSECT)

• Add two new fields (FROM and TO) to the original Roads feature class.

• Join the START_INTERSECT feature class with the original Roads feature class using the Road Names as a joining field. Next you want to compare the two (original and Joined) Road Name fields and select the records where the two fields are NOT DUPLICATE (You will have duplicate records because INTERSECT will generate two records where a line is split due to difference in Name). Once the non-duplicate records are selected you want to CALCULATE FIELD for FROM.

• Repeat the same process for TO.

• Roads that end at a dead end will have NULL values.

• Do a QA/QC at the end to make sure your results make sense.

0 Kudos
SarahHartholt
Occasional Contributor III

I'm looking for a way to automate the process since there are ~2000 lines in my road layer. 

I'm currently trying to create an arcade expression that will select points from the START_INTERSECT layer, look at the  Road_Name attribute and return the Road_Name that does not match the Road_Name of the centreline. i.e. 2 points intersect with MARY AVENUE, I would like the FROM value to be WELLINGTON MAIN STREET.

I think I need to add the point feature class Road_Names to a list/array, compare each item in the array to the Road_Name of the line feature class and return the value that does not match. Not sure what the syntax for that looks like yet.

0 Kudos
SarahHartholt
Occasional Contributor III

I think I'm getting close here. I created a model to iterate through my road layer and perform the following calculation on the From field:

 

 

 

var fsRoadName = $feature.Road_Name;
var fsPointName = FeatureSetByName($datastore, "Start_Intersect",["Road_Name"],true);
var intersectLayer = Intersects(fsRoadName,fsPointName);
var Result = [];

//grab Road ID for the point
for (var i in intersectLayer){
var RoadName = i.Road_Name;
}
// evalulate if the road names are not the same
if (fsRoadName != RoadName){
Push(Result, RoadName);
return Result;}

else {

return null;}

  

 

 

 

 

0 Kudos
SarahHartholt
Occasional Contributor III