Skip to main content
Question

Compare 2 shapefile for changes


Forum|alt.badge.img

Hi There, I recently upgraded my workspace from version 2015 64 bit to 2016 64 bit. This workspace generates a shapefile as an output. I noticed that there are differences in records count in these shapefiles. I want to know the difference between the two file shapefiles to see what changed. I was hoping that ChangeDetector transformer might do this but it show all the records as changed, curious if there is a better transformer suited for this. Thanks Jay

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

redgeographics
Celebrity
Forum|alt.badge.img+58

There's an UpdateDetector transformer on the FME Hub that provides a bit more information than the ChangeDetector.


jneujens
Forum|alt.badge.img
  • May 24, 2017

What were your settings in the ChangeDetector? Only based on geometry?


david_r
Celebrity
  • May 25, 2017

If you compare geometries, be aware that FME uses full precision for the comparison. This means that a point at (1.000000001, 1.000000001) isnt' identical to a point at (1.0, 1.0)

You can e.g. either use a CoordinateRounder or an AnchoredSnapper to work around this.

If you could post a screen capture from the Data Inspector of two features that should be identical but are identified as changed, that would be very helpful for us.


Forum|alt.badge.img
  • Author
  • May 25, 2017

Hi All, Thanks for the input. I tried all these transformers (Change Detector, Update Detector, and Matcher). These are slight differences from each. As per comment from David, my Change Detector transformer has Lenient Geometry Matching to No, I will try changing to True. That might take care of full precision. I am going through few test cases and will post my findings here. I have attached screenshot of results from each transformer comparison. Thanks Jay


takashi
Celebrity
  • May 28, 2017

Hi @jaygis, seemingly you haven't set the Selected Attributes in the ChangeDetector, but the UpdateDetector requires you to set the Key Attribute and the Attributes to Match parameter. So it's natural that there could be a difference between the results from those two transformers depending on how you have set those parameters.

The Matcher compares all the input features regardless of the source datasets, and the matched two or more features will be output via the Matched / SingleMatched port, even if they belong to the same source dataset. Therefore, it's also natural that there could be a difference between the result from the Matcher and the result from either the ChangeDetector or the UpdateDetector.

If you set Yes to the Lenient Geometry Matching parameter, the transformer determine that the two geometries are matched even though the order of vertices is opposite each other. However, the parameter never mean "be lenient on slight difference between coordinates". If you want to allow some tolerance when comparing the geometries, consider using a transformer to modify the coordinates beforehand, as @david_r mentioned.


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