Question

Sequence data based on from to values

  • 9 January 2019
  • 7 replies
  • 13 views

Userlevel 1
Badge +21

I have some features with attributes as follows

 

fromto41444146412441815406700241214124700299663418141449966399661540675406414654067

 

And I'm aiming to reprder/assign an ordered value so that the from value equals the to value of the preceding feature.

 

fromto41214124412441814181414441444146414654067540675406540670027002996639966399661

 

All suggestions appreciated.


7 replies

Badge

Use a Sorter to sort your data on your from column and then use Adjascent Feature Handling in AttributeManager to apply the previous 'from' to the current to

 

 

Userlevel 1
Badge +21

Use a Sorter to sort your data on your from column and then use Adjascent Feature Handling in AttributeManager to apply the previous 'from' to the current to

 

 

Sorry, I've not explained properly, the from and to values are paired,

if the first feature has values from: 4121 and to: 4124 the next value needs to be the feature that has a from value of 4124. If this then has a to value of 4181 the next feature needs to be the one wiht a from value of 4181 and so on

Userlevel 2
Badge +17

A geometric solution.

Userlevel 4

An option would be to use the "Number of subsequent features" of the AttributeCreator (or AttributeManager.

See sample template: sequence.fmwt

Userlevel 1
Badge +21

An option would be to use the "Number of subsequent features" of the AttributeCreator (or AttributeManager.

See sample template: sequence.fmwt

Unfortunately, the workflow isn't producing the output I want. I've probably not explained the requirements properly. The values are pairs, the pairs must remain as is but in a different order.

Userlevel 1
Badge +21

A geometric solution.

This looks promising. I'll test with some real data

Badge +3

Use a Sorter to sort your data on your from column and then use Adjascent Feature Handling in AttributeManager to apply the previous 'from' to the current to

 

 

sorting and adjacent handling will not create the sequence. ( I suggest a demerit for the answer, though I dare not click negative..;))

This is because there is a "switchback" in the dataset.

 

This is solved if you simply put the values in order (on any axis) as @takashi has done using the linecombiner. (if they where text you would need to use a counter to enumerate them first)

All you need to do is either extract coordinates of line after the line combiner and merge to the original set (no path splitter needed in that case)

or

extract coordinates after the path splitter and rename them (from becomes _indices{0}.x and to becomes _indices{1}.x

Reply