Skip to main content
Solved

Get value from index +1


clowncutie
Contributor
Forum|alt.badge.img+7

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

Best answer by hkingsbury

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/

View original
Did this help you find an answer to your question?

2 replies

hkingsbury
Celebrity
Forum|alt.badge.img+54
  • Celebrity
  • Best Answer
  • May 15, 2025

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/


clowncutie
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • May 23, 2025
I

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings