Bug report #20591

Dissolve tool failing to produce outputs

Added by Andy Harfoot over 5 years ago. Updated over 5 years ago.

Assignee:Alessandro Pasotti
Affected QGIS version:3.4.1 Regression?:No
Operating System:Win 10 x64 Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:28411


I'm seeing very strange behaviour with a particular shapefile in QGIS 3.4.1. The data is attached

When I run the Vector Geometry > Dissolve Processing tool on it, no errors are raised, an output layer is created containing one row with no geometry. This happens regardless of the Processing 'Invalid features filtering' setting.

Running the GDAL > Vector geoprocessing > Dissolve tool on the data immediately returns an invalid geometry (self intersection) error, but running Vector Geometry > Check validity finds no errors using either the GEOS or QGIS engine. The ArcGIS Check Geometry tool also fails to find any errors.

If the Vector Geometry > Dissolve tool is run on a selection from the shapefile, it will complete successfully if all but one feature is selected, regardless of which feature is left unselected.

DissolveFail.zip (76.9 KB) Andy Harfoot, 2018-11-22 11:43 AM

qgis-dissolve-error.png (238 KB) Alessandro Pasotti, 2018-11-22 02:30 PM

qgis-dissolve-error-2.png (145 KB) Alessandro Pasotti, 2018-11-22 02:35 PM


#1 Updated by Andy Harfoot over 5 years ago

The dissolve works fine using the corresponding tool in 2.18.15

#2 Updated by Alessandro Pasotti over 5 years ago

Ok, first step was to show the error message (see attached).

Second step is to understand if the error message (which comes from GEOS library) makes sense.

#3 Updated by Alessandro Pasotti over 5 years ago

Looks like the problem is in the GEOS library... I'm using GEOS 3.5.1.

I would be in favor of closing as upstream.

#4 Updated by Andy Harfoot over 5 years ago

Both my QGIS 3.4.1 and 2.18.15 use an identical version of GEOS (3.7.0-CAPI-1.11.0), yet the dissolve completes in 2.18 but not in 3.4.

#5 Updated by Andy Harfoot over 5 years ago

Does GDAL share the GEOS library in a QGIS install, or have its own copy? The QGIS processing dissolve tool does not produce an error, nor any output, but the GDAL tool produces the GEOS error that is in the screenshot, could this be due to a different version being used?

#6 Updated by Alessandro Pasotti over 5 years ago

I'm not an expert about windows, but I'm pretty sure that GDAL and QGIS use exactly the same shared GEOS library.

The error message was not shown in 3.4 QGIS Dissolve algorithm (I'm going to fix that) but the error was thrown from GEOS and it was visible in the debug log.

It's wierd that it worked in 2.18, I'll check it, but it is also possible that in 2.18 the algorithm implementation was completely different: a lot of code has changed from 2.x to 3.x.

#7 Updated by Andy Harfoot over 5 years ago

Yes, dissolve appears to be a 'native' algorithm now, no python script available in 3.4

#8 Updated by Alessandro Pasotti over 5 years ago

That explains the different behavior.

#9 Updated by Nyall Dawson over 5 years ago

Even the older python dissolve tool used the geos library to dissolve. Your older 2.18.15 build will be using an earlier geos version, so I suspect that something has changed within geos which is causing this error. Likely if you upgraded to 2.18.23, which will come with the newer geos library, you'll also see this error.

#10 Updated by Alessandro Pasotti over 5 years ago

The error is definitely in GEOS, I've been able to reproduce it in a GEOS test.

#11 Updated by Alessandro Pasotti over 5 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • Status changed from In Progress to Closed
  • Resolution changed from up/downstream to fixed/implemented

Fixed in master and 3.4

Also available in: Atom PDF