Skip to main content

Hi. Today's second question, I'm glad that this forum exists 🙂 I'm sending the "example" file in the attachment. I would need advice on a transformer where I could implement a sequence of individual segments. I have an idea, but I don't know how to implement it in WS. StartPoint and EndPOint is one segment. I need to determine the correct order of the segments. To get the correct order, I need to determine the first and last point - the value of the first point must meet the condition of occurrence in "startpoint" and at the same time it must occur only once ( A1 ). If I manage to determine the first segment, I need to further apply that the endpoint value of the first segment ( A2 ) is the starting value ( startpoint ) of the following segment. This way the correct sequence will be connected. Some ideas?

 

@fmesafe.podpora​ If your data is literally A1, A2, etc. then Sorter will do it. If the data is actual coordinates then try LineCombiner followed by Chopper (assuming each segment is only two vertices).


@fmesafe.podpora​ If your data is literally A1, A2, etc. then Sorter will do it. If the data is actual coordinates then try LineCombiner followed by Chopper (assuming each segment is only two vertices).

In fact, A1, A2 are point names, the designation A1 and A2 is to simplify the example. In reality, A1 represents the WEBCA value and A2 the LISMO value, etc. (point names).


In fact, A1, A2 are point names, the designation A1 and A2 is to simplify the example. In reality, A1 represents the WEBCA value and A2 the LISMO value, etc. (point names).

So presuming you could have something like A1 - A3, A2-A4, A3-A2

 

I think i asked a very similar question sometime in 2019, struggling to find it though.


If you can assign some numeric values to your start and end points you should be able to use takashi's solution here

https://community.safe.com/s/question/0D54Q000080hKzUSAU/sequence-data-based-on-from-to-values


So if you want to go from something like this

imageto this

imageWhere each end point is the start point of the subsequent feature, the attached workspace should do this

 


FROM YOUR EXAMPLE :

Do you need only one row at the destination FOR A1?

I mean

FIRST POINT, ENDPOINT

A1 , A6


If you can assign some numeric values to your start and end points you should be able to use takashi's solution here

https://community.safe.com/s/question/0D54Q000080hKzUSAU/sequence-data-based-on-from-to-values

THank you, I will look at it


So if you want to go from something like this

imageto this

imageWhere each end point is the start point of the subsequent feature, the attached workspace should do this

 

Thanks a lot, this looks complicated. I will try to put in WS and see what the result is.


FROM YOUR EXAMPLE :

Do you need only one row at the destination FOR A1?

I mean

FIRST POINT, ENDPOINT

A1 , A6

Hi. No, I need all the points that belong to the A1 track - chronologically


So if you want to go from something like this

imageto this

imageWhere each end point is the start point of the subsequent feature, the attached workspace should do this

 

Hi. Tried pasting in WS but not working on output. I created the data source that I am finally working with, I'm sorry, I should have created it already in the first query. I am sending in an attachment. I am also sending the final file, this is what the output should look like - there is no resolved chronology here. Could you please look at it again? Thank you very much.


Hi. Tried pasting in WS but not working on output. I created the data source that I am finally working with, I'm sorry, I should have created it already in the first query. I am sending in an attachment. I am also sending the final file, this is what the output should look like - there is no resolved chronology here. Could you please look at it again? Thank you very much.

I am also attaching the output. You have to download the whole file, the whole line is not visible in the preview


Hi , Just check if this works. or . this is what you are looking for? fmw attached.


Hi , Just check if this works. or . this is what you are looking for? fmw attached.

Hi. Thank you for answer. Unfortunately this doesn't work outside of the example where I only have the point name. I posted the real data in the reply above a while ago. But thanks a lot for your time, I appreciate it.


I'm not sure i fully understand the ask, or your expected output. If you look at route A1 in your sample input, is this what you are looking to get?

image


So if you want to go from something like this

imageto this

imageWhere each end point is the start point of the subsequent feature, the attached workspace should do this

 

Now I thought of one more thing...the coordinates I can add to the thing, I have them deleted at the moment but they are in the data source, would that help with the problem? In the attachment. After determining the first point according to the conditions at the beginning of the query, it might be possible to define the chronology according to the coordinates - the result should be the flight path. There should not be a case where the plane flies from point A to point C and back to point B


The output should look like this - but it must be chronological according to the conditions in the beginning of the query. Individual segments display the correct sequence of points, but only in pairs. I need to determine the order of individual segments so that the correct chronology of points is exported from the segment. I'm sorry if I'm not being precise.


The output should look like this - but it must be chronological according to the conditions in the beginning of the query. Individual segments display the correct sequence of points, but only in pairs. I need to determine the order of individual segments so that the correct chronology of points is exported from the segment. I'm sorry if I'm not being precise.

You will have to explain how BANKO appears second in that list for A1 when it doesn't appear to be the start point for any segment so therefore logically can only be the final end point. equally ?BRY is not the end point for any segment so could only logically be the first start point?


You will have to explain how BANKO appears second in that list for A1 when it doesn't appear to be the start point for any segment so therefore logically can only be the final end point. equally ?BRY is not the end point for any segment so could only logically be the first start point?

This is just an example of what the output file should look like, I wrote that the point names are not lined up correctly - that's actually what we're trying to solve. Points are correct: ?BRY ?LUREN DJL LISMO SIROD DINOX SPR SOFIK ODNUP WEBCA BANKO


So the original suggestion will work fine with a few amendments, you can use your start and end coordinates in the vertex creator, then instead of splitting the list back into paths, you can concatenate the end points and add the start point to get your list of fixes

imageAlthough it does look like you have some duff data in there, e.g. A6 appears to be missing a segment

image


Oh, This is easy.

use aggregator transformer Group by ID.

concatenate the attributes(startpointDesignator) you need, while aggregating.

 


So the original suggestion will work fine with a few amendments, you can use your start and end coordinates in the vertex creator, then instead of splitting the list back into paths, you can concatenate the end points and add the start point to get your list of fixes

imageAlthough it does look like you have some duff data in there, e.g. A6 appears to be missing a segment

image

I know about this error, I will address it in the future. So that's cool, do you think you could send me the edit in FMWT? Thanks a lot


I know about this error, I will address it in the future. So that's cool, do you think you could send me the edit in FMWT? Thanks a lot

It looks like it works, that would be great. I'll think about the logic tomorrow, I'd like to understand how you arrived at this result. One last cosmetic question, how can I achieve such a modified output, see the attachment? I need data in one line under one track - the image in the attachment is just to show the data output, the points are not sequentially arranged.


I know about this error, I will address it in the future. So that's cool, do you think you could send me the edit in FMWT? Thanks a lot

Sorry, I uploaded the wrong file

This one should give you an attribute called List_of_Fixes which should give you what you need

 

Any routes that appear twice in the output have one or more missing segments


I know about this error, I will address it in the future. So that's cool, do you think you could send me the edit in FMWT? Thanks a lot

I know what the missing segments are, I can fix it. Absolutely great. Thank you very much for the advice, this has helped me a lot in my work. I appreciate your help.


Reply