Skip to main content

Not long ago I asked following question:

"I have a dataset of different lines and I create a new line with the "Creator". Now I want to test wether the crated line allready exists in my dataset. If the line doesn't allready exists, I want to edit the existing data and the new line separatly.

I tried to use the "Matcher". But if the new line does not already exist, it can no longer be separated from the existing data because there is only one common output for 'NotMatched'.

I hope somebody can help me."


so I got a very good answer by erik_jan

Try the ChangeDetector.

Use the Original port for the existing and the Revised port for the created line.

If it existed it will be output through Unchanged, if not it will be output through Added. Ignore the Deleted (that is Original not in newly created).

(see also : https://knowledge.safe.com/questions/22882/test-wh... )

It worked very well.

But now in addition to this, I have a further question.

If a street B (input in Revised Port) already exists it will be output through the Unchanged port and gets the ID of the already existing street, which was input through the Original port.

How can I achieve that this street B on the one hand gets the ID of the already existing street but on the other hand keeps it's attributevalues that were present in the Input?

Thanks

Nicole

Hi @nicole, add another ChangeDetector to the workspace, send the source street B features to its Original port, and send the features from the Unchanged port of the first ChangeDetector to its Revised port. Required features would be output through the Unchanged port of the second ChangeDetector.


Hi @nicole, add another ChangeDetector to the workspace, send the source street B features to its Original port, and send the features from the Unchanged port of the first ChangeDetector to its Revised port. Required features would be output through the Unchanged port of the second ChangeDetector.

Thank you that works very good! :)


Just thought I'd say, as far as I can see, it's not street B that
exits the Unchanged Port. It is street A - i.e. the original feature not
the revised feature. That's why it has Street A's set of attributes.
Anyway, I would go with Takashi's idea of a second ChangeDetector.


Reply