Solved

Sequential processing of elements


Badge +10

Hey. Do you have any idea how to solve the sequential processing of input elements on HorizonAngleCalculator? If I have several elements on the input of the Horizontal Transformer, I need one element to be processed and then the next element to follow after that element is processed. After that, I would put a featureholder after the HorizontalAngleCalculator and it might work. I've tried testing the featureholder with counter and filtering features that have already been processed, but somehow I can't get it to work. 

Thank you very much

icon

Best answer by geomancer 15 April 2024, 17:41

View original

21 replies

Userlevel 4
Badge +36

The HorizontalAngleCalculator (FME Hub) calculates the angle and azimuth of a line or polyline (or line created by connecting two input points).

All input features are processed independently, there is no sequential processing.

Badge +10

The HorizontalAngleCalculator (FME Hub) calculates the angle and azimuth of a line or polyline (or line created by connecting two input points).

All input features are processed independently, there is no sequential processing.

I understand, but how do I solve the situation if I need a calculated azimuth to each input element? I thought of calculating the azimuth using attributeCreator and replacing HorizontalAngleCalculator to be the azimuth value for each element, however I can't seem to get the result.

Badge +10

I understand, but how do I solve the situation if I need a calculated azimuth to each input element? I thought of calculating the azimuth using attributeCreator and replacing HorizontalAngleCalculator to be the azimuth value for each element, however I can't seem to get the result.

Badge +10

If I use the original WS from you and put another element on the input ( there will be about 50 of them ), the horizontalAngleCalculator will not work. My fault for putting only one element to test. However, the WS can definitely be used, you just might need to calculate the azimuth within the attributeCreator so that the azimuth to each input element is calculated. But I probably have some kind of error in the notation. I created a new FMWT file with the second element as well. If you would be willing to take another look, I would be grateful.

 

Thank you

Userlevel 4
Badge +36

Ah yes, I see something strange happening in the lower HorizontalAngleCalculator: 2 features enter, but only one exits. That cannot be right. For some reason calculating the azimuth from the specified coordinates is not working...

So in the lower part I changed this into calculating a line (as you already did in your original workspace), and determined the azimuth with HorizontalAngleCalculator from the feature (like I added to the top part). See the attached workspace.

Now 2 features exit the lower HorizontalAngleCalculator (which is correct), and I get an end result with 6 features.

 

Badge +10

Thank you so much for giving your time to the issue, I appreciate it. I'm flustered though, if I use all the input data, the workspace doesn't work correctly - the number of tracks doesn't match on the output of aggregator_6. If I also try some tracks, like M170, it looks like the sequence in one of the segments is wrong as well. Furthermore, if I try for example only track Q243 is rejected on the HorizontalAngleCalculator transformer. On the other hand, for example track L613, L867, M141 seems to be fine - I haven't had time to check it. I tried to create an fmwt with all the source data, I should have accessed the data comprehensively right away and not selected only the test tracks. To not confuse you, I added attributeManager transformers that rotate startpoint and endpoint. I hope this is just tweaking some detail.

Thank you very much

Badge +10

HMM OSN BASUM STADE ELSOB HAM

Thank you so much for giving your time to the issue, I appreciate it. I'm flustered though, if I use all the input data, the workspace doesn't work correctly - the number of tracks doesn't match on the output of aggregator_6. If I also try some tracks, like M170, it looks like the sequence in one of the segments is wrong as well. Furthermore, if I try for example only track Q243 is rejected on the HorizontalAngleCalculator transformer. On the other hand, for example track L613, L867, M141 seems to be fine - I haven't had time to check it. I tried to create an fmwt with all the source data, I should have accessed the data comprehensively right away and not selected only the test tracks. To not confuse you, I added attributeManager transformers that rotate startpoint and endpoint. I hope this is just tweaking some detail.

Thank you very much

I opened and closed the workspace and it ran without problems...Q243 is still incorrect, but that's probably specific as the track has few points. I will check more tracks and let you know, please disregard the previous post, I need to test more tracks and have relevant output, I would hate to burden you with inaccurate results.

Thank you very much and have a nice day

Badge +10

I do have one question now. If I take track L613, the correct order of points should be ?SML ?KHG ?DEPNO ?BOPOS ?IMREK ?KIVIL ?MMA ?ITEXO ?TANSA ?AMAXI ?VEGES ?DIRMI ?RESTI ?ALANI ?KOR ?RIMAX ? XANIS YNN VJOSA PAPIZ GONOT LUMAR MUJAC GARGA RIVAM UTAME VIC BORMI DIBAX SUXAN VALAV RONAG ARGAX ELMUR MANEG RIPUS DITON HOC ? DIPER ?VESAN ?RATUK ?SOVAT ?SANDY ?STOAT ?MOGLI ?BETAX ?MAMUL ?HALIF ?ABKAT ?TLA, but the output is ?TLA ?ABKAT ?HALIF ?MAMUL ? BETAX ?MOGLI ?STOAT ?SANDY ?SOVAT ?RATUK ?VESAN ?DIPER HOC DITON RIPUS MANEG ELMUR ARGAX RONAG VALAV SUXAN DIBAX BORMI VIC UTAME RIVAM GARGA MUJAC LUMAR GONOT PAPIZ VJOSA YNN ?XANIS ?RIMAX ?KOR ?ALANI ?RESTI ? DIRMI ?VEGES ?AMAXI ?TANSA ?ITEXO ?MMA ?KIVIL ?IMREK ?BOPOS ?DEPNO ?KHG ?SML - there was a correct alignment of the flow of points within the erroneous segment, but there was also a reversal of the entire direction of the track. Would it be possible to reverse only the points in the erroneous segment?
 

Badge +10

But of that amount of tracks, a certain part is still rejected.

Userlevel 4
Badge +36

Concerning your last remark:

204 features are rejected by HorizontalAngleCalculator_3. It appears the start and end points are identical for these features.

Badge +10

Concerning your last remark:

204 features are rejected by HorizontalAngleCalculator_3. It appears the start and end points are identical for these features.

Yes, I just wrote that they have identical coordinates :-)

Userlevel 4
Badge +36

It was very interesting to see all routes. But seeing the data, I don't think we can build a workspace that solves all problems for all routes.

So I think you will have to find an optimum between automatic processing with FME, and manual corrections afterwards.

I hope my additions to your workspace provide a starting point for this.

Badge +10

It was very interesting to see all routes. But seeing the data, I don't think we can build a workspace that solves all problems for all routes.

So I think you will have to find an optimum between automatic processing with FME, and manual corrections afterwards.

I hope my additions to your workspace provide a starting point for this.

I'm glad you can find it at least a little interesting when you take the time to discuss my problem, I appreciate it, thank you. I will see what the result of the testing will be, if there would be a slight amount of corrections, it is bearable. Alternatively, one would then have to create a filter of the directions of each track and make maybe 4 categories, where each category would have a range of degrees and treat each category differently...I don't know, I won't get ahead of myself. 

Do you still know how to elegantly solve the direction see L613? The track has the correct sequence of points, but it starts from the end.

Thank you, have a nice day

Userlevel 4
Badge +36

The most simple way to turn around L613 (and other routes that you want to turn around) may be to add a data set that identifies what routes to flip, something like this:

 

Badge +10

The most simple way to turn around L613 (and other routes that you want to turn around) may be to add a data set that identifies what routes to flip, something like this:

 

Okay, thank you, I'll work something similar. I'm still struggling with the previous problem unfortunately, are you sure the orientation is working correctly? If I send the data on, I can't achieve the correct point sequence, see the transformer tester named L613. The correct point sequence should be ?SML ?KHG ?DEPNO ?BOPOS ?IMREK ?KIVIL ?MMA ?ITEXO ?TANSA ?AMAXI ?VEGES ?DIRMI ?RESTI ?ALANI ?KOR ?RIMAX ? XANIS YNN VJOSA PAPIZ GONOT LUMAR MUJAC GARGA RIVAM UTAME VIC BORMI DIBAX SUXAN VALAV RONAG ARGAX ELMUR MANEG RIPUS DITON HOC ? DIPER ?VESAN ?RATUK ?SOVAT ?SANDY ?STOAT ?MOGLI ?BETAX ?MAMUL ?HALIF ?ABKAT ?TLA. I've been tinkering with it for half a day and can't get the right result :-(

Userlevel 4
Badge +36

I think when you flip the line, you also need to flip the point sequence?

The ListReverser (FME Hub) may be of help here: Split the attribute with the point sequence to a list, reverse the list, and reconstruct the point sequence with a ListConcatenator.

 

 

Badge +10

I think when you flip the line, you also need to flip the point sequence?

The ListReverser (FME Hub) may be of help here: Split the attribute with the point sequence to a list, reverse the list, and reconstruct the point sequence with a ListConcatenator.

 

 

Do you mean the sequence of points just the points from the flip direction on the testfilter that leads to the transformer orientor, or all the points that belong to the track - that would include the points from the keepdirection. Could you attach the fmwt file for me please? thank you very much

Badge +10

Do you mean the sequence of points just the points from the flip direction on the testfilter that leads to the transformer orientor, or all the points that belong to the track - that would include the points from the keepdirection. Could you attach the fmwt file for me please?

Thank you very much

Badge +10

I think when you flip the line, you also need to flip the point sequence?

The ListReverser (FME Hub) may be of help here: Split the attribute with the point sequence to a list, reverse the list, and reconstruct the point sequence with a ListConcatenator.

 

 

On which branch of the transformer do you mean to work this?

Userlevel 4
Badge +36

I had not looked at your workspace when I came up with the ListReverser. Unfortunately I see no easy way to add that part to the workspace.

I thought about swapping the values of startpointDesignator and EndpointDesignator after the Orienter (with the AttributeSwapper from FME Hub), but that doesn't give the results I hoped it would.

Badge +10

I had not looked at your workspace when I came up with the ListReverser. Unfortunately I see no easy way to add that part to the workspace.

I thought about swapping the values of startpointDesignator and EndpointDesignator after the Orienter (with the AttributeSwapper from FME Hub), but that doesn't give the results I hoped it would.

I tried swapping the startpoint and endpoint values after the orientor only on the points that are supposed to be Flip direction using the attributemanager transformer and the L613 result is correct. I'll try to test it on more tracks.

Thank you very much

Reply