Skip to main content
Solved

Use change detector and keep attributes (further question to an existing question)


Forum|alt.badge.img

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

Best answer by takashi

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.

View original
Did this help you find an answer to your question?

3 replies

takashi
Evangelist
  • Best Answer
  • March 10, 2016

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.


Forum|alt.badge.img
  • Author
  • March 10, 2016
takashi wrote:

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! :)


mark2atsafe
Safer
Forum|alt.badge.img+48
  • Safer
  • March 10, 2016

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings