Skip to main content
Solved

Change detector attribute no matching problem


arxit
Contributor
Forum|alt.badge.img+5
  • Contributor

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

Best answer by trentatsafe

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.
View original
Did this help you find an answer to your question?

27 replies

david_r
Celebrity
  • August 8, 2017

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


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • August 8, 2017

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


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • August 8, 2017

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


arxit
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 8, 2017

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


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • August 8, 2017
arxit wrote:

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?

 

 


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • August 8, 2017

This is what the ChangeDetector settings should look like:


arxit
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 8, 2017
erik_jan wrote:
Can you show a screenshot of the ChangeDetector settings?

 

 

Yes, here are the parameters :

 

 

 


david_r
Celebrity
  • August 8, 2017

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.


david_r
Celebrity
  • August 8, 2017
erik_jan wrote:

This is what the ChangeDetector settings should look like:

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

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • August 8, 2017

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:


arxit
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 8, 2017
david_r wrote:

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

 

 


arxit
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 8, 2017
erik_jan wrote:

This is what the ChangeDetector settings should look like:

Yes, it's the same that I used too

 

 


arxit
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 8, 2017
erik_jan wrote:

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

 

 


arxit
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 9, 2017
erik_jan wrote:

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

I don't check geometries in the script

 

 


david_r
Celebrity
  • August 9, 2017

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.


trentatsafe
Safer
Forum|alt.badge.img+6
  • Safer
  • Best Answer
  • August 9, 2017

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.

Forum|alt.badge.img+2
  • August 9, 2017

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.


david_r
Celebrity
  • August 9, 2017
trentatsafe wrote:

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.

Forum|alt.badge.img+2
  • August 9, 2017
trentatsafe wrote:

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.

arxit
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 9, 2017
david_r wrote:

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 !

 

 


arxit
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 9, 2017
trentatsafe wrote:

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

 


arxit
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 9, 2017
trentatsafe wrote:

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.

 


david_r
Celebrity
  • August 9, 2017
arxit wrote:
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.

david_r
Celebrity
  • August 9, 2017
arxit wrote:
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.

arxit
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 9, 2017
david_r wrote:

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

 

 


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