Skip to main content
Solved

Build Road New Road Network LRM from Existing One

  • January 10, 2018
  • 4 replies
  • 26 views

Forum|alt.badge.img
  • 6 replies

I have a county road network from which I want to create a state route road network. I feel like this should be easy and that I am missing something, so I'm posting it here for advice. Say I have the following data:

recordidcountyRtIdstateRtIdlrsBeginlrsEndx1y1x2y2*order*A1ASR1SR10100110A2ASR1SR11211221A3ASR1SR12333443A4ASR1SR13455665B1BSR1SR10222332B2BSR1SR12444554B3BSR1SR14666776

B4

BSR1SR16877887

The table above, I want to calculate the order column. The x1,y1, x2,y2 values represent the begin and end coordinates of the linestrings to which each record is associated. The stateRtId is a known state identifier, and the countyRtId is our identifier for the county.

In this example, ASR1 travels out of the county and then back in, demonstrating that the collection of linestrings by county is not always continuous. However, for purposes of this example, once can assume that all routes within the state route network are continuous.

Essentially, since I can already group all the linestrings together by a networkId--the stateRtId--I just need to know what is the simplest way to assemble this into the correct order from a geometry perspective.

Thanks.

Best answer by takashi

Hi @t2, if you create line segments from the x, y coordinates, the LineCombiner (Preserve Lines as Path Segments: Yes) can be used to create a Path geometry consisting of the segments, which has a list containing attributes of the original records in the order along the resulting line. You can then decompose the Path with the PathSplitter to get sorted records from the list. The Segment Number attribute will store required order value.

If you don't need to keep geometries finally, the ListExploder can also be used instead of the PathSplitter. In the case of using a ListExploder, you don't need to use the "Preserve Lines as Path Segments" option, and it would be better to remove the resulting line geometry before exploding the list, in order to prevent copying useless geometry data.

Hope this helps.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

osalex
Contributor
Forum|alt.badge.img+5
  • Contributor
  • 4 replies
  • January 10, 2018

Could you use a sorter and then counter?


takashi
Celebrity
  • 7843 replies
  • Best Answer
  • January 10, 2018

Hi @t2, if you create line segments from the x, y coordinates, the LineCombiner (Preserve Lines as Path Segments: Yes) can be used to create a Path geometry consisting of the segments, which has a list containing attributes of the original records in the order along the resulting line. You can then decompose the Path with the PathSplitter to get sorted records from the list. The Segment Number attribute will store required order value.

If you don't need to keep geometries finally, the ListExploder can also be used instead of the PathSplitter. In the case of using a ListExploder, you don't need to use the "Preserve Lines as Path Segments" option, and it would be better to remove the resulting line geometry before exploding the list, in order to prevent copying useless geometry data.

Hope this helps.


david_r
Celebrity
  • 8394 replies
  • January 11, 2018

Hi @t2, if you create line segments from the x, y coordinates, the LineCombiner (Preserve Lines as Path Segments: Yes) can be used to create a Path geometry consisting of the segments, which has a list containing attributes of the original records in the order along the resulting line. You can then decompose the Path with the PathSplitter to get sorted records from the list. The Segment Number attribute will store required order value.

If you don't need to keep geometries finally, the ListExploder can also be used instead of the PathSplitter. In the case of using a ListExploder, you don't need to use the "Preserve Lines as Path Segments" option, and it would be better to remove the resulting line geometry before exploding the list, in order to prevent copying useless geometry data.

Hope this helps.

I agree. I would also add that if you need to set the M-values of the vertices (I would guess based on lrsBegin and lrsEnd), then you can use a MeasureSetter after each VertexCreator.

Forum|alt.badge.img
  • Author
  • 6 replies
  • January 11, 2018

Hi @t2, if you create line segments from the x, y coordinates, the LineCombiner (Preserve Lines as Path Segments: Yes) can be used to create a Path geometry consisting of the segments, which has a list containing attributes of the original records in the order along the resulting line. You can then decompose the Path with the PathSplitter to get sorted records from the list. The Segment Number attribute will store required order value.

If you don't need to keep geometries finally, the ListExploder can also be used instead of the PathSplitter. In the case of using a ListExploder, you don't need to use the "Preserve Lines as Path Segments" option, and it would be better to remove the resulting line geometry before exploding the list, in order to prevent copying useless geometry data.

Hope this helps.

Hi Takashi,

 

Thanks, I think this approach will work.

 

 

Tom