Solved

Change detector attribute no matching problem


Badge +4

Hi everyone,

I am using a ChangeDetector, only on one attribute "parcelle", to compare differences between polygon layers, but there is a problem because all of the polygons are detected as "changed" (then they should not, because values of "parcelle" attributes are the same in the two layers) :

Port 1 (Added) :

Port 2 (Deleted) :

I thought that the problem was because of the encoding of these attributes. So I have tried to use the AttributeEncoder Transformer, but it changes nothing :

I also have tried a FeatureMerger on these attributes and it works.

Thank you.

Aurélien

icon

Best answer by trentatsafe 9 August 2017, 09:31

View original

27 replies

Userlevel 4

Have you verified for precision differences? Try inserting a CoordinateRounder to 3 decimal places on both datasets before the ChangeDetector.

Userlevel 1
Badge +10

In the change detector are you matching geometries as well as attributes?

Userlevel 2
Badge +12

And if you are checking geometry, are both datasets using the same coordinate system?

Badge +4

Thank you for your replies.

No, i don't check geometries, but only one attributes ("parcelle").

My Datasets using both the same coordinate system (EPSG 2154).

Userlevel 2
Badge +12

Thank you for your replies.

No, i don't check geometries, but only one attributes ("parcelle").

My Datasets using both the same coordinate system (EPSG 2154).

Can you show a screenshot of the ChangeDetector settings?

 

 

Userlevel 2
Badge +12

This is what the ChangeDetector settings should look like:

Badge +4
Can you show a screenshot of the ChangeDetector settings?

 

 

Yes, here are the parameters :

 

 

 

Userlevel 4

Try inserting a StringFormatter with the format string "s" (only the letter s, no quotes) on both datasets entering the ChangeDetector:

You could also try inserting an AttributeTrimmer as well, in case there are any spaces or non-printable characters.

I was not able to reproduce the issue using FME 2017.1.

Userlevel 4

This is what the ChangeDetector settings should look like:

Yep, exactly the same as I used in FME 2017.1, worked as expected.
Userlevel 2
Badge +12

Another thing to try is to read the "parcelle" attribute from both sources as integer.

To change the reader feature type you need to change this setting:

Badge +4

Try inserting a StringFormatter with the format string "s" (only the letter s, no quotes) on both datasets entering the ChangeDetector:

You could also try inserting an AttributeTrimmer as well, in case there are any spaces or non-printable characters.

I was not able to reproduce the issue using FME 2017.1.

I've tried with StringFormatter with "s" before ChangeDetector but no changes :

 

 

I've also tried to create a new attribute, but it's the same

 

 

Badge +4

This is what the ChangeDetector settings should look like:

Yes, it's the same that I used too

 

 

Badge +4

Another thing to try is to read the "parcelle" attribute from both sources as integer.

To change the reader feature type you need to change this setting:

I tried but the result is the same

 

 

Badge +4

And if you are checking geometry, are both datasets using the same coordinate system?

I don't check geometries in the script

 

 

Userlevel 4

Try temporarily replacing the ChangeDetector with a FeatureMerger, merge on "parcelle". If the behavior is the same, I pretty much guarantee that the problem is with the features themselves and not a bug with FME.

You could also consider posting a small sample dataset here that exhibits the problem, that would be very helpful.

Badge +6

Hello @arxit,

 

Are you able to attach your workspace or a sample of the data(1feature from each source to an FFS file would work)?

 

 

Secondly, on one of the images, 'pict-1.png' it almost appears that there is whitespace at the end of the value so rather than '1391' it looks like it could be '1391 '. Are you able to just verify this? I think I may just be seeing things/stretching it.
Badge +2

I've had some interesting challenges with the ChangeDetector/UpdateDetector in the past.

 

 

To debug I suggest you use a Tester to only allow through one equivalent polygon from each stream, then remove all the attributes except the one your are testing against. Then check the results. If it works OK then start to isolate the problem by allowing attributes through.

Alternatively can you post a screen capture of the two relevant features (using Run with Breakpoints) just before they enter the ChangeDetector.

Finally, post the data with a small sample. You can use the Recorder transformer to create an FFS file that you can upload.

Userlevel 4

Hello @arxit,

 

Are you able to attach your workspace or a sample of the data(1feature from each source to an FFS file would work)?

 

 

Secondly, on one of the images, 'pict-1.png' it almost appears that there is whitespace at the end of the value so rather than '1391' it looks like it could be '1391 '. Are you able to just verify this? I think I may just be seeing things/stretching it.
I agree about the trailing space. I'm curious to know if he tried the AttributeTrimmer, as suggested.
Badge +2

Hello @arxit,

 

Are you able to attach your workspace or a sample of the data(1feature from each source to an FFS file would work)?

 

 

Secondly, on one of the images, 'pict-1.png' it almost appears that there is whitespace at the end of the value so rather than '1391' it looks like it could be '1391 '. Are you able to just verify this? I think I may just be seeing things/stretching it.
@david_r suggested an AttributeTrimmer yesterday and @arxit shows an example shortly after with a StringFormatter, but not AttributeTrimmer.
Badge +4

Try temporarily replacing the ChangeDetector with a FeatureMerger, merge on "parcelle". If the behavior is the same, I pretty much guarantee that the problem is with the features themselves and not a bug with FME.

You could also consider posting a small sample dataset here that exhibits the problem, that would be very helpful.

Yes, i had tried the FeatureMerger on this attribute and it worked !

 

 

Badge +4

Hello @arxit,

 

Are you able to attach your workspace or a sample of the data(1feature from each source to an FFS file would work)?

 

 

Secondly, on one of the images, 'pict-1.png' it almost appears that there is whitespace at the end of the value so rather than '1391' it looks like it could be '1391 '. Are you able to just verify this? I think I may just be seeing things/stretching it.
Hello,

 

As suggested by mark_1spatial, I have test only one polygon and i have removed all attributes except "parcelle".

 

I inserted loggers (in attachments : script-log.zip), two after my sources and two after ChangeDetector (in outputs).

 

Badge +4

Hello @arxit,

 

Are you able to attach your workspace or a sample of the data(1feature from each source to an FFS file would work)?

 

 

Secondly, on one of the images, 'pict-1.png' it almost appears that there is whitespace at the end of the value so rather than '1391' it looks like it could be '1391 '. Are you able to just verify this? I think I may just be seeing things/stretching it.
Thank you. With a StringReplacer " " by "" on attribute "parcelle", it works !

 

I'm sorry about the simplicity of this problem.

 

Userlevel 4
Hello,

 

As suggested by mark_1spatial, I have test only one polygon and i have removed all attributes except "parcelle".

 

I inserted loggers (in attachments : script-log.zip), two after my sources and two after ChangeDetector (in outputs).

 

Your value of "parcelle" in the REVISED source contains a trailing space.
Userlevel 4
Thank you. With a StringReplacer " " by "" on attribute "parcelle", it works !

 

I'm sorry about the simplicity of this problem.

 

The AttributeTrimmer suggested yesterday would've fixed your problem.
Badge +4

Try inserting a StringFormatter with the format string "s" (only the letter s, no quotes) on both datasets entering the ChangeDetector:

You could also try inserting an AttributeTrimmer as well, in case there are any spaces or non-printable characters.

I was not able to reproduce the issue using FME 2017.1.

AttributeTrimmer works ! I didn't see this yesterday (i had only tried StringFormatter). Thank you very much

 

 

Reply