Bug report #19307

Processing OGR Dissolve having problems with blanks in filename

Added by Andreas Wicht almost 6 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:Giovanni Manghi
Category:Processing/Core
Affected QGIS version:3.3(master) Regression?:No
Operating System: Easy fix?:Yes
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27135

Description

When trying to dissolve a layer which has a blank in the filename, the OGR Dissolve tool produces an error.
Blanks in the path are handled correctly.
The OGR Buffer Vectors tool works in both cases.

2018-06-29T10:09:48     INFO    ogr2ogr C:/Users/andreas.wicht/AppData/Local/Temp/processing_487fcaefef2c4ca0912034dbbe57979c/cf3b5d9bffb748ccb6d9f060d02ee4e4/OUTPUT.shp "C:/temp/hexbins2 2.shp" -dialect sqlite -sql "SELECT ST_Union(geometry) AS geometry, gid FROM hexbins2 2 GROUP BY gid" -f "ESRI Shapefile" 
2018-06-29T10:09:48     INFO    GDAL execution console output
             ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2(SELECT ST_Union(geometry) AS geometry, gid FROM hexbins2 2 GROUP BY gid):

              near "2": syntax error

I guess quotes at the table name are missing in the sqlite SQL statement.

Associated revisions

Revision a3af1f9f
Added by Nyall Dawson over 5 years ago

[processing][gdal] Add unit tests for Dissolve algorithm

Also:

Thanks to @agiudiceandrea:

Fixes #19900
Statistics were erroneously computed on the dissolve field, rather than on the statistic attribute field as it should be.

Fixes #19307
Handle filenames with white spaces (in the same way as Buffer, OffsetCurve, OneSideBuffer, PintsAlongLines algs).

History

#1 Updated by Giovanni Manghi almost 6 years ago

  • Assignee set to Giovanni Manghi

#2 Updated by Andrea Giudiceandrea over 5 years ago

  • Pull Request or Patch supplied changed from No to Yes

Giovanni,
I've submitted a PR that should fix this bug and also #19900 in 3.3.0-master
PR https://github.com/qgis/QGIS/pull/7964

Andreas,
if you want to fix the Dissolve alg for your installation of QGIS 3.2, you can directly modify [QGIS install dir]\apps\qgis\python\plugins\processing\algs\gdal\Dissolve.py replacing every occurrence of

FROM {}

with

FROM '{}'

#3 Updated by Andrea Giudiceandrea over 5 years ago

  • Easy fix? changed from No to Yes

#4 Updated by Andrea Giudiceandrea over 5 years ago

  • Affected QGIS version changed from 3.2 to 3.3(master)
  • Operating System deleted (Windows 10)
  • Assignee changed from Giovanni Manghi to Andrea Giudiceandrea

#5 Updated by Andrea Giudiceandrea over 5 years ago

  • Assignee changed from Andrea Giudiceandrea to Giovanni Manghi

#6 Updated by Nyall Dawson over 5 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF