Skip to main content

So I have multiple columns of data that return a yes or no value. I'm really only concerned with the yes value.

 

When the value in the Cut Grass attribute is 'Yes' - i want to replace the Yes with say "cut grass to 100mm"

Then i have another Yes value in Remove Flammable materials column and I want to replace the Yes with "remove materials".

 

Is there a multiple string replacer transformer that I can use.

 

I need to do this for approx 13 different attributes. I have read about string replacer or attribute value mapper. But whilst string replacer can replace multiple attributes to the same replacement text it doesn't allow for differing replacement text individual to a column.

I think the SchemaMapper should be able to do this (but I'd struggle to tell you exactly how)


Maybe the Conditional Value option from the AttributeManager can help you out.

 


I'm not sure there is a straightforward FME solution

 

A python solution in this case is much simpler and easier to manage imo

import fme
import fmeobjects
 
def processFeature(feature):
    mydict = {'Cut_Grass':'cut grass to 100mm','Remove_Flammable_Materials':'remove materials'}
    attrs = feature.getAllAttributeNames()
    for a in attrs:
        if feature.getAttribute(a)=='Yes':
            feature.setAttribute(a,mydict(a])

 


Maybe the Conditional Value option from the AttributeManager can help you out.

 

Hi Geomancer - yep i stumbled across this...and yes it is working perfectly. Thanks for your help

 


I think the SchemaMapper should be able to do this (but I'd struggle to tell you exactly how)

I had a go and it was easier than I expected! You can find it in this video - about 30 minutes in, after another SchemaMapper question.


Reply