Solved

Sorting segments


Badge +10

Hello. Does anyone have knowledge of how to determine the sequential order of segments based on already created geometry? Or any other option? For example, I have L616 tracks where I need to combine the points in the list of fixes into one value. If I use the aggregator, I have values in one column, but the values are not consecutive, see the aggregator attachment - the aggregator writes segments - DENKO BINPO VELAB MISKA ETNEL PEKOT DESEN continues KEROP NIVIS VAL REDVA ?KOGAT ?BITLA and ends NIT TABIN ALAMU. It should be correctly DENKO BINPO VELAB MISHKA ETNEL PEKOT DESEN continues NIT TABIN ALAMU and ends KEROP NIVIS VAL REDVA ?KOGAT ?BITLA

Individual segments that have an expected trajectory from top to bottom are in the attachment.

 

Thank you very much

icon

Best answer by DanAtSafe 14 March 2023, 08:45

View original

13 replies

Userlevel 2
Badge +17

Hi @fmesafe.podpora​,

Instead of the Aggregator, please use a LineCombiner with Generate List enabled. This will create an ordered list on the resulting lines. You can then use a ListConcatenator to combine the list of names into a single attribute, similar to that output by the Aggregator, but properly ordered.

Badge +10

Hi @fmesafe.podpora​,

Instead of the Aggregator, please use a LineCombiner with Generate List enabled. This will create an ordered list on the resulting lines. You can then use a ListConcatenator to combine the list of names into a single attribute, similar to that output by the Aggregator, but properly ordered.

Thanks for the reply, but I'm probably doing something wrong somewhere, or this isn't working. My track is still fragmented, if I look in the data inspector I still only see the attributes of one segment. I tried connecting the track via lineCloser, but it didn't help. Settings and outputs from the transformer in the attachment.output_from_the_ListConcatenatoroutput_from_the_lineCombinerdatainspectorlineCombinerSettingssetiings_listConcatenator

Badge +10

Hi @fmesafe.podpora​,

Instead of the Aggregator, please use a LineCombiner with Generate List enabled. This will create an ordered list on the resulting lines. You can then use a ListConcatenator to combine the list of names into a single attribute, similar to that output by the Aggregator, but properly ordered.

I don't know if I understand this correctly, but I think the problem is that the three pieces of track are not in one complete line.

Userlevel 2
Badge +17

I don't know if I understand this correctly, but I think the problem is that the three pieces of track are not in one complete line.

Yes, the LineCombiner will not be able to bridge the gaps in the lines. However the names will be properly ordered within each joined section. Joining the sections in the correct order is much more complex with only the geometry to work with. In this case, you could use a CenterPointExtractor to get a rough Y value of each section, then join themusing an Aggregator with a list. Use a ListSorter to sort the list by the Y value, then concatenate the name lists together. However the trend may be different for other sections, so it's hard to create a universal algorithm.

If you could the originating application to supply an order value on the sections, the solution would be much simpler - just aggregate and order the list by that value.

Userlevel 1
Badge +11

I don't know if I understand this correctly, but I think the problem is that the three pieces of track are not in one complete line.

Hi @fmesafe.podpora​ If you don't have any attributes, the attached template demonstrates a way to create lines in the "gaps" using a NeighborFinder which will help the LineCombiner order the elements in the final aggregate line.

Badge +10

I don't know if I understand this correctly, but I think the problem is that the three pieces of track are not in one complete line.

Hi, thank you very much for your reply, but I can't get the correct result. I tried changing the settings of individual transformers, but my best result was creating two segments that were connected correctly, but the third lowest (KEROP NIVIS VAL REDVA ?KOGAT ?BITLA) was still separated. Would it be possible to look at real data? I am attaching the fmwt.

 

Thank you for trying to resolve the issue, I appreciate it.

Badge +10

I don't know if I understand this correctly, but I think the problem is that the three pieces of track are not in one complete line.

Hi, I have the point names (eg NIT, TABIN, ALAMU) sorted correctly in each segment. I have a problem with the correct sequence of segments. This is an air route and must follow logically in the direction see attachment. In the chain it is correct: DENKO BINPO VELAB MISK ETNEL PEKOT DESEN / NIT TABIN ALAMU / KEROP NIVIS VAL REDVA ?KOGAT ?BITLA. Now I have the wrong order: DENKO BINPO VELAB MISKA ETNEL PEKOT DESEN / KEROP NIVIS VAL REDVA ?KOGAT ?BITLA / NIT TABIN ALAMU. I will try to try the variant with CenterPointExtractor, as you write, but I have no experience with this solution. Thank you very much.1.segment2. segment3. segment

Badge +10

I don't know if I understand this correctly, but I think the problem is that the three pieces of track are not in one complete line.

One more important thing, the free spaces between segments can be different throughout the area. I don't know if a fixed setting on NeighborFinder in the maximum distance line won't cause problems.

Userlevel 1
Badge +11

I don't know if I understand this correctly, but I think the problem is that the three pieces of track are not in one complete line.

@fmesafe.podpora​ I have modified the workspace so that it looks for the input lines as neighbors and not the ends of those lines. (This is asssuming that the ends of the lines are the closest points to the nearest neighbor.) It should have also connected the NotMatched port from the Matcher to the AttributeKeeper.

 

There's no way to know beforehand the distance between the gaps, so the higher the better. Your units are decimal degrees - ideally you would first reproject into a local coordinate system.

Badge +10

I don't know if I understand this correctly, but I think the problem is that the three pieces of track are not in one complete line.

Hello. Thanks a lot for the reply. I tested with the reference track ( L616 ) and the result is correct. But if I work with all the data on the input, the result is fragmented. I went step by step transformer by transformer and on LineCombiner_2 I don't have one geometry, but three. Do you think it could be a large concentration of tracks? Thank you very much

Userlevel 1
Badge +11

I don't know if I understand this correctly, but I think the problem is that the three pieces of track are not in one complete line.

Hi @fmesafe.podpora​ You'll have to check the group_by attributes - 'name' and/or 'list_of_fixes', as well as the Maximum Distance in the NeighborFinder. I also added a Matcher to eliminate lines without matches by 'name'. The only remaining problem is where 'name' = 'Y100' ; the lines aren't "aligned", i.e. the closest point on one to the other is not the end point.

Badge +10

I don't know if I understand this correctly, but I think the problem is that the three pieces of track are not in one complete line.

Hi, yes I see. Y100 is probably an error in the source data, I will have to verify this. But the segments are far apart. I will try to test the last solution in the whole WS and let you know. Thank you very much for your time and solving my problem!

Badge +10

I don't know if I understand this correctly, but I think the problem is that the three pieces of track are not in one complete line.

Hello,

I have it tested and probably everything works. Thank you very much for your support in solving the problem.

Thanks!

Reply