2

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

  • 1
    At least the input_layer has ring self-intersection at POINT ( 39.21075154537676 -6.883819577332873). Try if fixing it would help. OpenJUMP is computing differences even without fixing source data at least for couple of the first layers which I tried. – user30184 Nov 18 '15 at 15:36
1

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!

  • THANKS!!! Incredibly helpful. All working perfectly now! – usabledata Nov 19 '15 at 12:46
  • @usabledata - Awesome buddy! Glad it worked :) – Joseph Nov 20 '15 at 10:53
  • I can't figure out how to get my QGIS layers into a GRASS mapfile to run v.clean on them... – Baodad Oct 6 '17 at 19:52
  • 1
    @Baodad - Run QGIS with GRASS, either create or open an existing mapset, use v.in.ogr.qgis or v.in.ogr to import a vector layer. You can then run v.clean on the newly imported GRASS layer :) – Joseph Oct 9 '17 at 9:09

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.