Skip to main content

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.

Could you use a sorter and then counter?


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 @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.

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

 

 

 


Reply