0

I am trying to run the difference algorithm with points as the input layer and a polygon as the overlay layer. I've tried many different point layers and polygon layers and it keeps giving me the error

GEOS geoprocessing error: difference failed.

It does work with a polygon input layer and a point overlay layer as well as polygons as both input and overlay layers.

This algorithm worked a year ago in a model I built but now it seems to have changed.

Edit I switched to 'extract by location' - disjoint. I am curious why the difference algorithm has changed. The mysteries of QGIS...

brink
  • 820
  • 9
  • 23
  • 1
    See here for possible solutions: https://gis.stackexchange.com/q/408820/88814 – Babel Sep 10 '21 at 20:07
  • @Babel thats for a points layer as input AND overlay. I have a polygon as an overlay – brink Sep 10 '21 at 20:55
  • No problem - the principles should work as well in this context. – Babel Sep 10 '21 at 21:23
  • @Babel it's not the principles I'm having issue with. It's just not working. – brink Sep 10 '21 at 21:30
  • If you buffer the points, it does not work? You're trying to delete those points that are within a polygon - right? Would that be a solution: select points within polygon, then delete them? – Babel Sep 11 '21 at 07:13
  • 3
    Odd if it worked before. I can find similar questions: https://stackoverflow.com/questions/40818679/geopandas-difference-methode-between-polygon-and-points, https://gis.stackexchange.com/questions/263664/points-and-polygons-difference-issue-qgis. Removing something from the interior of a polygon should create a hole, but point has no area so the hole would also have a zero area. – user30184 Sep 12 '21 at 20:28
  • @Babel, I can do a workaround no problem. I'm wondering if anybody is having the same issue. If this is a bug it should be fixed. – brink Sep 13 '21 at 17:22
  • 1
    Polygon minus point cannot work - conceptually: or how should the result look like? This is not a QGIS problem. Only point minus point can work. – Babel Sep 13 '21 at 18:15
  • Maybe it can help you: https://gis.stackexchange.com/a/305193/99589 – Taras Sep 13 '21 at 18:21
  • 1
    @Taras : one of the famous, all time top answers here on GIS SE! – Babel Sep 13 '21 at 18:49
  • I think you are overestimating it :) – Taras Sep 13 '21 at 19:10

1 Answers1

3

The "GEOS geoprocessing error: difference failed" issue with the "Difference" processing algorithm is now fixed in the developer version QGIS 3.27.0-Master starting from the 5a6b76a commit, and will be fixed in the stable versions starting from QGIS 3.26.1 and from QGIS LTR 3.22.10.

See https://github.com/qgis/QGIS/pull/49300.

Andrea Giudiceandrea
  • 1,319
  • 10
  • 17