Skip to main content

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

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


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


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


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).


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?

 

 


This is what the ChangeDetector settings should look like:


Can you show a screenshot of the ChangeDetector settings?

 

 

Yes, here are the parameters :

 

 

 


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.


This is what the ChangeDetector settings should look like:

Yep, exactly the same as I used in FME 2017.1, worked as expected.

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:


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

 

 


This is what the ChangeDetector settings should look like:

Yes, it's the same that I used too

 

 


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

 

 


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

I don't check geometries in the script

 

 


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.


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'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.


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.

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.

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 !

 

 


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).

 


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.

 


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.
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.

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