Question

Compare 2 shapefile for changes


Badge

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


5 replies

Userlevel 5
Badge +25

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

Badge

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

Userlevel 4

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.

Badge

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

Userlevel 2
Badge +17

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.

Reply