Skip to main content

I have 7 features, which each represents a route with unique trip_id.

 

Each of these features have a list, containing buss_stop_id along the route and element index, as well as next sequence value. I want to add, either in the list or in the features after list exploder, the value for the buss_stop_id for the next one. I played around with list builder and exploader for a long time and cant figure it out. Tried some ugly solution @Value(_list{@Value(_list{0}.next_sequence)}.buss_stop_id) but did not worka s intended

 

So in my example I want the end result to be something like next_buss_stop_id an attribute in _list{1} which is the buss_stop_id from _list{2}

Meaning _list{2} = buss_stop_id = 363, next_buss_stop_id 364

One approach would be exploding the list out so each element is its own feature. Then in an AttributeManager or AttributeCreator enable Adjacent Feature Attributes (under Advanced). 

This will allow you to look at the next feature and use those values to populate the current one. Note that this will need to be in conditional logic (checking that the next features attribute has a value) so the last feature isn’t trying to reference data that doesn’t exist.

https://fme.safe.com/blog/2017/08/adjacentfeatureattributes-evangelist166/


I

Im almost a bit angry that the solution was there all along :D atleast I got really good at learning lists.