Skip to content
Permalink
Browse files

Do not pass None to len()

  • Loading branch information
strk committed Oct 20, 2016
1 parent 06976a2 commit 797181534360ebf68145d5bf787cc5d3a65c9e93
Showing with 16 additions and 18 deletions.
  1. +16 −18 python/plugins/processing/algs/gdal/warp.py
@@ -143,13 +143,13 @@ def getConsoleCommands(self):
arguments = []
arguments.append('-ot')
arguments.append(self.TYPE[self.getParameterValue(self.RTYPE)])
if len(srccrs) > 0:
if srccrs:
arguments.append('-s_srs')
arguments.append(srccrs)
if len(dstcrs) > 0:
if dstcrs:
arguments.append('-t_srs')
arguments.append(dstcrs)
if noData and len(noData) > 0:
if noData:
arguments.append('-dstnodata')
arguments.append(noData)
arguments.append('-r')
@@ -165,21 +165,19 @@ def getConsoleCommands(self):
extra = self.getParameterValue(self.EXTRA)
if extra is not None:
extra = str(extra)
regionCoords = rastext.split(',')
try:
rastext = []
rastext.append('-te')
rastext.append(regionCoords[0])
rastext.append(regionCoords[2])
rastext.append(regionCoords[1])
rastext.append(regionCoords[3])
except IndexError:
rastext = []

if GdalUtils.version() >= 2000000:
if rastext and rastext_crs:
arguments.append('-te_srs')
arguments.append(rastext_crs)
if rastext:
regionCoords = rastext.split(',')
if len(regionCoords) >= 4:
arguments.append('-te')
arguments.append(regionCoords[0])
arguments.append(regionCoords[2])
arguments.append(regionCoords[1])
arguments.append(regionCoords[3])

if GdalUtils.version() >= 2000000:
if rastext_crs:
arguments.append('-te_srs')
arguments.append(rastext_crs)

if extra and len(extra) > 0:
arguments.append(extra)

0 comments on commit 7971815

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