QGIS ‘Difference’ Tool Returns Empty Layers: Troubleshooting Guide

differencesgeoprocessingqgisqgis-2.10

I've been using QGIS's difference tool to create some new layers. All was going well until I hit a number of layers which return a blank layer with no features when I use the difference tool.

The shapefiles for the input and difference layers can be found at https://www.dropbox.com/sh/bd43bd3mtbsxu9r/AABW5RWlZn9iXiMYorD8Xftra?dl=0

QGIS 2.10.1 – Pisa running on OSX 10.10.5

Best Answer

As @user30184 mentioned, there are errors in your "input_layer". You can use the GRASS tool v.clean to clean most of the errors. Use the break option with a threshold of 0.1. This should 'break' your single polygon into multiple polygons (you can uncheck the Errors output as you don't really need this):

v.clean

Cleaned input_layer

If you want, could dissolve this based on an attribute field (doesn't matter which, all values are the same). I also found it easier to merge all your "difference_layers" using Vector > Data Management Tools > Merge Shapefiles to One:

Merged difference_layers

Finally, you should be able to run the difference tool now using your newly cleaned and merged layers:

Difference tool

Difference result

Hope this helps!

Related Question