Question

Feature grouping based on string value

  • 1 February 2022
  • 5 replies
  • 10 views

Badge +3

Hello there

the data we have looked like this as a sample

steaure calssificationas you can see each end value of the r-name is the start of the next feature

the goal is to group them based on this relationship

end result should look

fature_grupingThanks

 

 


5 replies

Badge +10

You can do this with adjacent attribute mapping. If you split r_name by the hyphen, you can then use a conditional statement to assess whether the end of the previous value matches the start of the current value. If there is a match, use the group id from the previous value, otherwise increment by 1

image

Badge +3

You can do this with adjacent attribute mapping. If you split r_name by the hyphen, you can then use a conditional statement to assess whether the end of the previous value matches the start of the current value. If there is a match, use the group id from the previous value, otherwise increment by 1

image

@ebygomm​ 

Thanks for your replay

I cant find the transformer could u please share the complete name

just a note the features are not coming in order all the time, is this will work

Thanks

Badge +10

@ebygomm​ 

Thanks for your replay

I cant find the transformer could u please share the complete name

just a note the features are not coming in order all the time, is this will work

Thanks

The transformer is an AttributeCreator, you could also use an AttributeManager. This workflow would rely on the features coming through in order.

Badge +10

If you can't rely on order this is another approach using the excellent ListCombiner custom transformer. You would need to add 1 to the Group ID if you wanted group numbering to start from 1 instead of 0

 

image

Badge +10

Example

 

Reply