8

I am trying to separate two overlapping vector layers and find out the difference in QGIS 2.18. I have tried finding difference with layers with points and also with buffers. Both of them give following error:

global name 'QgsWKBTypes' is not defined See log for more details

I have searched the web for this but can't seem to find a solution.

1

2 Answers 2

12

This problem was already fixed in the source code, see the reported issue.

You have mainly 3 solutions:

Mid term solution

According to the road map, QGIS 2.18.1 will be released in 25.11.2016, you'll get the fix with such version. Simply wait 22 days for it, OK?

BUT

This is free software, so you can get the fix instantly!

Short term solutions

  1. Install a nightly build. Check what packages are available for your operating system here.

  2. Edit the file yourself.

    If you're on GNU/Linux, go to /usr/share/qgis/python/plugins/processing/algs/qgis/Difference.py (on Windows it will be C:\Program Files\QGIS 2.18\apps\qgis\python\plugins\processing\algs\qgis\Difference.py), and make sure line 32 looks like this:

    from qgis.core import QGis, QgsFeatureRequest, QgsFeature, QgsGeometry, QgsWKBTypes 
    

    If you don't want to edit the file, you can just replace it, downloading the fixed file from here (right click on the link and select Save Link As...).

    You will need administrator privileges to either edit or replace the file. After this, restart QGIS.

1
  • my Difference.py file looks like you write, but it didn't work anyway(
    – Jane
    Commented Jun 13, 2018 at 12:42
0

other solution - Try Difference from SAGA vector polygon tools - it works!

enter image description here

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