I'm looking for a tool which compares two vector files (eg shapefiles). Eg 2 versions of a river network. Quite a lot of the records are equal, but some are different. A possible output would be eg a shapefile with every geometry and 2 columns which refer to the id of the 2 original files, which can be missing if that geometry is not present in one of the files.

I'm thinking about a strategy to program this myself (basically creating a hashed version of the geometry of each part and compare those), but before rushing into programming (I even have a fancy name 'shapediff') I was wondering if such a tool already exists.

  • Did you consider/try file based versioning (e.g. subversion, git, mercurial). If not, why? If so, what was your experience? – Ben Mearns Jun 10 '13 at 15:13
  • Could be an option, but in that case I should convert to a text-based format (eg kml) first. Diffs between binary files (such as shape and dbf) are not useful and usually don't exist. But even then I can still not visualise the differences ("patches"). – johanvdw Jun 10 '13 at 15:19

Ok, I found a tool myself: http://www.obviously.com/gis/shpdiff/ - see if I can make it work.

  • I made some changes to make it compile, but it doesn't really do what I would like to do. I guess I'll write my own program. – johanvdw Feb 11 '11 at 21:36

There is a Feature Compare tool in the Data Management Tools > Data Comparison toolbox. Here is the link to the Desktop 10 help page. Script examples in Python is available at the bottom of the page.

I haven't used the tool myself (that I can remember anyway) so I'm not sure if it will generate the output you are looking for. Might be worth a look.

  • Thanks for reporting. But we've experienced many problems with this tool (only compared 234 records out of thousands). – johanvdw Jan 11 '11 at 18:33
  • Ah, I was not aware - you did not mention that you had used the tool in your original post. – Timothy Michael Jan 11 '11 at 19:07
  • Don't worry - I made my question general in the hope that it would be a reference for other people facing the same problem. – johanvdw Jan 11 '11 at 21:11

I've had good results with this script: Change Detector

  • Just for a reference: this script does not work on arcgis 9.3, so no solution here unfortunately. – johanvdw Feb 11 '11 at 21:38
  • I wasn't aware this was 9.3 specific. The script is heavy on arcpy, but you could easily port this it to the 9.3 arcgisscripting way of doing things. The script doesn't do anything that is specific to 10. – Derek Swingley Feb 11 '11 at 21:48

FME has a couple transformers that might help you.

  1. ChangeDetector

    From the help file:

    Detects changes between two sets of input features.

    This transformer is often used with multiple readers, to identify changed features in the two files. It can identify all features that two input files have in common, and those which are in one file and not the other, such as the additions and the deletions.

    enter image description here

  2. Matcher

    From the help file:

    Detects features that are matches of each other. Features are declared to match when they have matching geometry, matching attribute values, or both. A list of attributes which must differ between the features may also be specified.

    enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.