Split Line at Points while saving the direction of the Line Feature

2580
6
Jump to solution
05-05-2020 03:46 PM
by Anonymous User
Not applicable

Hi,

I'm very much in need of a way to Split Lines at Points and save the direction of the original Line Feature, for example with attribute fields "FromPointID" and "ToPointID", or any other way. Because I need to do this for a huge amount of features, there is no way I could do this manually. I've been thinking of how to do this for quite a while, but couldn't figure out how to do it.

For example:

Take a Line Feature --- and it's their direction >

0--------------------------------------------------------->16 (Point ID 0 and 16 are known)

The Line Feature is intersected by Point IDs

0-------->11------>23---------->15---------->76--->16

What I need is to split the Line Feature 0--->16 it into 5 Line Features including the direction

0-------->11

11------>23

23---------->15

15---------->76

76--->16

Btw, what I'm trying to do is to create bi-directional flow maps for public transit with network analyst.

Best regards

Christian

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Thank you very much! Actually, while I was trying your solution I got another idea and discovered a way which seems to work:

  1. Split Lines at Points
  2. Add Fields four fields and calculate the Line start x and y coordinates, Line end x and y coordinates; then Concatenate x and y coordinates
  3. Calculate x, y coordinates of the Point Features; then Concatenate x and y coordinates
  4. Join the Point ID to the Lines based on the Concatenate x y coordinates field.

Split Lines at Points keeps the direction as far as I can see, and I can "output" the direction by calculating the coordinates of the start and endpoints of the Line features.

View solution in original post

0 Kudos
6 Replies
DanPatterson_Retired
MVP Emeritus
by Anonymous User
Not applicable

Basically yes, but my problem is the following:

  1. It does not output the Point IDs which the Lines were splitted at
  2. It does not output the direction of the splitted Line. I'm modelling flow, so I need to know whether the flow is for example 11------>23 or 11<------23. I need this direction information stored somehwere, so that I can separately select the splitted Lines 11------>23 and 11<------23.
0 Kudos
DanPatterson_Retired
MVP Emeritus

try a Near afterwards

Near—Help | Documentation 

It will bring over the coordinates and if memory serves, the ID of the points

Check the image on the link as well as the output parameters.

Spatial Join—Help | Documentation 

is another one to look at.

by Anonymous User
Not applicable

Thanks for your replies!

I tried both Near and Spatial Join, however, both tools only joined one of the Point IDs instead of Start and End Point ID. Also, as far as I see, there is still no indication of the direction (moving towards or away from the joined Point ID)

In order to be clear what I want I created a graphic (sorry for my poor paint skills): My dataset has line features and point features. Then I have other Line Features (routes) overlaying the dataset, which I want to split along the points (grey) while extracting the direction (for example as "from Point ID" and "To Point ID")

0 Kudos
DanPatterson_Retired
MVP Emeritus

Well nothing seems to be helping, so last stab...

Feature Vertices To Points—Data Management toolbox | Documentation 

to get the vertices of your split polylines,

Then from there Near or spatial join to get the sequence of points.

This type of problem may be better suited to a coding solution based on a query of the points of the resultant split polylines.  I have also not examined in any detail if splitting may result in segment orientation flipping. I have however, found some idiosyncracies associated with the generation of shapes from point sequences which raises that possibility.

by Anonymous User
Not applicable

Thank you very much! Actually, while I was trying your solution I got another idea and discovered a way which seems to work:

  1. Split Lines at Points
  2. Add Fields four fields and calculate the Line start x and y coordinates, Line end x and y coordinates; then Concatenate x and y coordinates
  3. Calculate x, y coordinates of the Point Features; then Concatenate x and y coordinates
  4. Join the Point ID to the Lines based on the Concatenate x y coordinates field.

Split Lines at Points keeps the direction as far as I can see, and I can "output" the direction by calculating the coordinates of the start and endpoints of the Line features.

0 Kudos