Skip to content
Permalink
Browse files

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

  • Loading branch information
alexbruy committed Jan 21, 2016
1 parent 085c12e commit fe2bb2f09fe799c1363a206ced23bb2a5a1b3b38
Showing with 5 additions and 0 deletions.
  1. +5 −0 python/plugins/processing/algs/gdal/ClipByMask.py
@@ -112,6 +112,8 @@ def defineCharacteristics(self):
def getConsoleCommands(self):
out = self.getOutputValue(self.OUTPUT)
mask = self.getParameterValue(self.MASK)
maskLayer = dataobjects.getObjectFromUri(
self.getParameterValue(self.MASK))
ogrMask = self.ogrConnectionString(mask)[1:-1]
noData = unicode(self.getParameterValue(self.NO_DATA))
addAlphaBand = self.getParameterValue(self.ALPHA_BAND)
@@ -147,6 +149,9 @@ def getConsoleCommands(self):

arguments.append('-cutline')
arguments.append(ogrMask)
if maskLayer.subsetString() != '':
arguments.append('-cwhere')
arguments.append(maskLayer.subsetString())

if cropToCutline:
arguments.append('-crop_to_cutline')

0 comments on commit fe2bb2f

Please sign in to comment.
You can’t perform that action at this time.