Bug report #11972

GdalTools clipper: wrong command when mask layer has a filter

Added by Zoltan Siki about 5 years ago. Updated about 4 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:GDAL Tools
Affected QGIS version:2.6.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:20179

Description

I found a bug in GdalTools/Clipper, when a mask layer is used with a filter expression, the generated gdalwarp command is is not valid. The generated command looks like this:
gdalwarp -q -cutline "poly.shp|layerid=0|subset=\\"Nev\\" = 'Heves'" -crop_to_cutline input.tif output.tif

the correct command would be:
gdalwarp -q -cutline "poly.shp" -cwhere="Nev='Heves'" -crop_to_cutline input.tif output.tif

I suppose in getArgsModeMask (doClipper.py) after line 167 the mask should be processed if it contains "|".

Associated revisions

Revision fe2bb2f0
Added by Alexander Bruy about 4 years ago

[processing] take in account vector subsets when clipping raster (fix #11972)

History

#1 Updated by Giovanni Manghi about 5 years ago

  • OS version deleted (2.6)
  • Operating System deleted (All)
  • Category set to GDAL Tools
  • Subject changed from GdalTools plug-in clipper to GdalTools clipper: wrong command when mask layer has a filter

#2 Updated by Alexander Bruy about 4 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF