Solved

User parameter instead of attributes list in ChangeDetector?

  • 23 February 2023
  • 2 replies
  • 5 views

Badge +4

Hello, I want to replace the list of attributes of the ChangeDetector with a user parameter. The attributes of the original and revised features are not exposed. The user parameter is in Python: it's a string derived from another parameter (example: 'field1 field2 field3'). I don't get any error but I guess values are not considered.

I have the same problem​ with other transformers based on the same attribute list type (AttributeExposer).

It is an issue or a problem with the string? Thank you

icon

Best answer by markatsafe 24 February 2023, 18:50

View original

2 replies

Badge +2

@dhaulagiri​ ChangeDetector does accept a parameter:

imageTry creating the parameter in the ChangeDetector and then link that to your python parameter.

AttributeExposer will not accept a dynamic list of attributes because it's an 'authoring' tool and adds attributes to the workbench schema. Adding attributes in AttributeExposer will add attributes down stream, like AttributeManager, which can't be done dynamically. In most cases, just because attributes are not exposed in the workbench schema, they are still on the features and will be written out.

 

Badge +4

@Mark Stoakes​ , you have unlocked the situation, thank you! This solution works perfectly. I was candid in thinking that it was enough for the parameter to simply return a string formatted like what you see when you just select attributes. It's apparently a bit more than that!

For AttributeExposer, I wrote too quickly: it is correct that it is different. Actually, I meant CRCCalculator, which is also right next to it in my workbench. Whoops.

I retain that it is preferable to create the user parameter directly in the transformer which uses it.

Reply