Bug report #18167
I have a modification to make r.mapcalc (grass7/processing toolbox) work with windows 7 and QGIS Master (2.99...)
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Processing/GRASS | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Windows | Easy fix?: | No |
Pull Request or Patch supplied: | Yes | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 26058 |
Description
Hi,
I have a modification to make r.mapcalc (from QGIS/GRASS 7 processing toolbox) work with windows 7 and QGIS Master (2.99...)
In the file : https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/grass7/Grass7Algorithm.py
You should replace in "def exportRasterLayersIntoDirectory" :
for cmd in [self.commands, self.outputCommands]:
# TODO Windows support
# TODO Format/options support
cmd.append("for r in $(g.list type=rast pattern='{}*'); do".format(basename))
cmd.append(" r.out.gdal -m{0} input=${{r}} output={1}/${{r}}.tif {2}".format(
' -t' if colorTable else '', outDir,
'--overwrite -c createopt="TFW=YES,COMPRESS=LZW"'
)
)
cmd.append("done")
By this:
for cmd in [self.commands, self.outputCommands]:
# TODO Windows support
# TODO Format/options support
cmd.append("for /f %r in ('\"g.list type=rast\"'); do r.out.gdal -m{0} input=%r output={1}/%%r.tif {2}".format(
' -t' if colorTable else '', outDir,
'--overwrite -c createopt=\"TFW=YES,COMPRESS=LZW\"'
)
)
My modification gives this :
Associated revisions
processing: add windows support to exportRasterLayersIntoDirectory (fixes #20146)
History
#1 Updated by Giovanni Manghi almost 7 years ago
- Pull Request or Patch supplied changed from No to Yes
- Status changed from Open to Feedback
- Priority changed from High to Normal
Please file a pull request in the QGIS code repository. Thanks!
#2 Updated by Alexander Bruy almost 7 years ago
- Assignee deleted (
Alexander Bruy)
#3 Updated by Olivier ATHIMON almost 7 years ago
Giovanni Manghi wrote:
Please file a pull request in the QGIS code repository. Thanks!
I do it :
commit:e5981c9eb41ff87f0827e14afb39361bb6a6fc8e
#4 Updated by Giovanni Manghi almost 7 years ago
Olivier ATHIMON wrote:
Giovanni Manghi wrote:
Please file a pull request in the QGIS code repository. Thanks!
I do it :
commit:e5981c9eb41
Hi,
I tested the code (on Windows) and it works which is of course very cool (despite the fact that using r.mapcalc is very cumbersome because is needed to manually write the input file names and that the output is not added to the project).
I have anyway 2 questions:
is the code tested on Linux?
where is your PR?
I cannot find it here
https://github.com/qgis/QGIS/commits?author=ilikeqgis
is not among open or closed ones
#5 Updated by Jürgen Fischer about 6 years ago
- Resolution set to fixed/implemented
- Status changed from Feedback to Closed
"duplicate" of #20146