Skip to content

Commit fd50ac0

Browse files
committed
[processing] fix passing distunits parameter for GDAL proximity (fix #8247)
1 parent fbedfae commit fd50ac0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

python/plugins/processing/gdal/scripts/proximity.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@
4848

4949
gdal.AllRegister()
5050
options.append( 'MAXDIST=' + str(maxdist))
51-
options.append( 'VALUES=' + values )
52-
options.append( 'DISTUNITS=' + str(distunits))
51+
if len(values) > 0:
52+
options.append( 'VALUES=' + values )
53+
if distunits == 0:
54+
options.append( 'DISTUNITS=GEO')
55+
else:
56+
options.append( 'DISTUNITS=PIXEL')
5357
options.append( 'NODATA=' + str(nodata))
5458
options.append( 'FIXED_BUF_VAL=' +str(fixed_buf_val))
5559

0 commit comments

Comments
 (0)