Skip to content

Commit

Permalink
[processing] take in account vector subsets when clipping raster (fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Jan 21, 2016
1 parent 085c12e commit fe2bb2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/plugins/processing/algs/gdal/ClipByMask.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit fe2bb2f

Please sign in to comment.