Okay so I'm using QGIS 2.10 (a couple of versions out of date, but shouldn't matter much, eh?) on Windows 7, and I can't figure out this supposedly a very basic geoprocessing tool DIFFERENCE.

I'm trying to use a small polygon to find the DIFFERENCE in a larger polygon that completely covers the smaller polygon, so the result should be the larger polygon minus the smaller polygon, and the shape would look like a donut or bagel, but every time the result comes back as empty.

I'm not sure what I'm doing wrong here, I tried switching the layers and nothing worked either.

I mean, there's only 2 inputs and 1 output for this tool, how difficult could it be?

  • Are the spatial references of both datasets clearly defined and at least compatible (preferably the same)? – Michael Stimson Apr 11 '17 at 22:31
  • Yes they should be, both are converted from KML, and I've saved them as SHP files. And they do overlap, the smaller one is completely inside the larger one. – Sonic Apr 11 '17 at 22:36
  • Okay i saved the .shp files as MapInfo .tab files and the DIFFERENCE tool worked. That's so weird though, I don't get why .shp files doesn't work. – Sonic Apr 11 '17 at 22:41
  • 3
    The most likely cause is an incorrect ring orientation or self intersection in either or both shapefiles which is likely cleaned when converted to a TAB file. – Michael Stimson Apr 11 '17 at 22:43
  • 1
    I'd strongly recommend upgrading to a newer version - there's been many many bug fixes since 2.10 was released. – ndawson Apr 12 '17 at 4:50

Okay so I saved the .shp files as MapInfo .tab files and the DIFFERENCE tool worked.

Although I have wonder why it doesn't work with .shp files.

Okay so the issue was identified up there by user Michael, this probably have something to do with the fact that I created the polygons in Google Earth and then saved them as KMLs, it was the quickest way by far to generate the accurate polygons that I needed.

| improve this answer | |

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.