Skip to main content
Question

Adding letters as sequential values


Relative beginner here! I'm trying to set up a workbench so it can take features, assign them groups and then assign sequential values per feature in a group. The Counter transformer does the first part but I need help with the second part. I've used the StatisticsCalculator transformer which adds sequential numbers but is there a way to add letters (e.g. a, b, c... and so on)? Or is there a way to do this in the text editor?

 

Thanks for any help!

5 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+38

You could use an AttributeValueMapper to map 0>a, 1>b etc

 

imageI don't know of any tools out of the box which would do this


redgeographics
Celebrity
Forum|alt.badge.img+50

This may vary based on encoding but...

 

You can use a ModuloCounter, set to max 26, and a CharacterCodeReplacer, in the standard ASCII set uppercase letters start go from 65 (A) to 90 (Z), lowercase ones from 97 (a) to 122 (z). So in your example, @Value(modulocount)+65 or @Value(modulocount)+97 would do the trick.


joepk
Influencer
Forum|alt.badge.img+20
  • Influencer
  • October 2, 2023
redgeographics wrote:

This may vary based on encoding but...

 

You can use a ModuloCounter, set to max 26, and a CharacterCodeReplacer, in the standard ASCII set uppercase letters start go from 65 (A) to 90 (Z), lowercase ones from 97 (a) to 122 (z). So in your example, @Value(modulocount)+65 or @Value(modulocount)+97 would do the trick.

This is a cool solution!


redgeographics
Celebrity
Forum|alt.badge.img+50
joepk wrote:

This is a cool solution!

Old computer skills to the rescue! 😂


  • Author
  • October 9, 2023

Thanks for the help all, much appreciated!


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