Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I often use the GNU diff tool to compare two files or even two folders for differences. I was wondering if there is a Python based tool out there that does basically the same for shapefiles?

In the first place I am interested in attribute comparison but to find also the differences in geometry would be very handy.

Maybe someone has a script at hand I could adopt from?

I do not have access to ArcGIS so it needs to be a Python standalone solution.

share|improve this question
1  
Have you had a look here and here? The "Changedetector" Python script (for ArcGIS) may be what you're looking for, but I don't know if it would work as a standalone without ArcGIS. –  Simbamangu May 1 at 7:52

2 Answers 2

up vote 5 down vote accepted

Do you know shpdiff which depends on shapelib? It's not Python but works similar to diff. You can get it from here: http://uwmike.com/maps/shapefiles/shpdiff.c

Some years ago I wrote a blog post about it.

share|improve this answer
    
This sounds promising! –  LarsVegas May 1 at 8:16

You're probably looking for something like this:

http://gdal.org/python/osgeo.ogr.Geometry-class.html

Also you can try Shapely. There should be few tools for comparing.

share|improve this answer
1  
This doesn't address the question at all. "There should be something..." is not very helpful. –  LarsVegas May 1 at 8:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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