Question

Hi there, I am looking for a transformer or a solution that allows me to check if any attribute of a feature has a specific value (e.g. string "remove"). Only then I want to remove the attribute. Renaming would work as well. Thanks for your help.

  • 14 January 2022
  • 5 replies
  • 4 views

Badge
Hi there, I am looking for a transformer or a solution that allows me to check if any attribute of a feature has a specific value (e.g. string "remove"). Only then I want to remove the attribute. Renaming would work as well. Thanks for your help.

5 replies

Badge +2

@friedhelm​ This is probably easiest solved in a small Python script. I've attached an example workspace (FME 2021). The Python will remove any attribute with the value "AWS" and also create a list of the removed attributes.

Userlevel 2
Badge +17

Hi @friedhelm​ , you can use the NullAttributeMapper too with the settings shown in the attached screenshot.remove-specific-attributes-with-nullattributemapper

Badge

Hi @friedhelm​ , you can use the NullAttributeMapper too with the settings shown in the attached screenshot.remove-specific-attributes-with-nullattributemapper

Dear Takashi, Mark thanks a lot. Eirher solution should work for me Friedhelm Kind regards, Friedhelm Moggert-Kägeler Solutions Director Maritime Spatial Data SevenCs GmbH Atlantic Haus Zirkusweg 1, 20359 Hamburg, Germany Phone +49 40 851 72 40 Fax +49 40 851 72 479 www.sevencs.com
Badge

@friedhelm​ This is probably easiest solved in a small Python script. I've attached an example workspace (FME 2021). The Python will remove any attribute with the value "AWS" and also create a list of the removed attributes.

Dear Takashi, Mark thanks a lot. Either solution should work for me Friedhelm Kind regards, Friedhelm Moggert-Kägeler Solutions Director Maritime Spatial Data SevenCs GmbH Atlantic Haus Zirkusweg 1, 20359 Hamburg, Germany Phone +49 40 851 72 40 Fax +49 40 851 72 479 www.sevencs.com
Userlevel 4
Badge +25

In case it helps, I selected this as one of our questions of the week and created a video about my solution to it here: https://www.youtube.com/watch?v=ZvSaHQ7gouI&t=2338s

Reply