File tree 1 file changed +9
-2
lines changed
python/plugins/processing/algs/grass7/ext
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,20 @@ def processCommand(alg):
38
38
""" Handle inline rules """
39
39
txtRules = alg .getParameterValue (u'txtrules' )
40
40
if txtRules :
41
+ # Creates a temporary txt file
42
+ tempRulesName = alg .getTempFilename ()
43
+
44
+ # Inject rules into temporary txt file
45
+ with open (tempRulesName , "w" ) as tempRules :
46
+ tempRules .write (txtRules )
47
+
41
48
raster = alg .getParameterValue (u'input' )
42
49
output = alg .getOutputFromName (u'output' )
43
50
alg .exportedLayers [output .value ] = output .name + alg .uniqueSufix
44
51
if raster :
45
52
raster = alg .exportedLayers [raster ]
46
- command = u"echo \" {} \" | r.reclass input={} rules=- output={} --overwrite" .format (
47
- txtRules , raster , output .name + alg .uniqueSufix )
53
+ command = u"r.reclass input={} rules=- output={} --overwrite < {} " .format (
54
+ raster , output .name + alg .uniqueSufix , tempRulesName )
48
55
alg .commands .append (command )
49
56
else :
50
57
alg .processCommand ()
You can’t perform that action at this time.
0 commit comments