1

I have a set of feature types for which I need to fill in some missing values. I thought the AdjacentFeatureNullAttributeMapper was exactly what I need, but when I try the dummy example from the documentation, it does not work.

This is the data:

ID  TreeSpecies
1 Oak
2 Maple
3 
4 
5 Pine
6 Oak

These are my settings:

enter image description here

I expected this:

ID  TreeSpecies TS_2
1   Oak         Oak
2   Maple       Maple
3   <NULL>      Maple
4   <NULL>      Maple
5   Pine        Pine
6   Oak         Oak

But I got this:

enter image description here

I'm using FME Workbench 2021.2.

Have I missed something or is the transformer not correctly implemented? And if it is the latter, is there an alternative to this transformer?

1
  • I think that's one of my custom transformers. I'll take a look and let you know if there's a problem with it. Commented Feb 22, 2023 at 16:08

1 Answer 1

1

OK, so there seems to have been a change to the AttributeManager transformer that stops this working. I've figured out a fix and published it to the FME Hub.

However, I only have FME2022 installed on my computer, so the transformer has been updated to that version and will not work on 2021.2

So, to have this work for you, you need to make the same fix as I did, on your computer.

  1. Locate AdjacentFeatureNullAttributeManager.fmx on your computer. For me it appears in C:\Users<myName>\AppData\Roaming\Safe Software\FME\FME Store\Transformers
  2. Open the fmx file in your version of Workbench
  3. Open the parameters for the AttributeManager

enter image description here

  1. Under Attribute Value, change the content from @Value($(AttrName)) to @Value(feature[0].$(AttrName))

enter image description here

It might turn the field to red, but that's not a problem. Click OK and save the fmx file. Now, whenever you use the AdjacentFeature..... transformer, it should use this version and it should work fine for you.

If you do have problems editing the fmx file or FME using it properly, you can always use the transformer in embedded mode instead. Just right-click on it and choose edit, then make the same change as above.

I hope this solves the issue. Apologies for the inconvenience that it caused.

2
  • Thanks it worked! What is the syntactic meaning of feature[0] in this case?
    – saQuist
    Commented Feb 27, 2023 at 9:06
  • Excellent. So with "adjacent" attributes, you can access them through using feature[x]. where the x is the feature number. So feature[-1].id means get the id number of the previous feature. feature[+1].id means the next feature, and feature[0] just means the current feature. It's quite neat functionality and opens up a lot of possibilities. Commented Feb 27, 2023 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.