Skip to content

Commit

Permalink
Merge pull request #1892 from neteler/master
Browse files Browse the repository at this point in the history
[processing] updates for GRASS GIS 7 support; file date updated in comment
  • Loading branch information
alexbruy committed Feb 8, 2015
2 parents 6ed695a + a18286f commit b1a2ccd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
15 changes: 8 additions & 7 deletions python/plugins/processing/algs/grass7/Grass7Algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
***************************************************************************
Grass7Algorithm.py
---------------------
Date : April 2014
Copyright : (C) 2014 by Victor Olaya
Date : February 2015
Copyright : (C) 2014-2015 by Victor Olaya
Email : volayaf at gmail dot com
***************************************************************************
* *
Expand All @@ -18,8 +18,8 @@
"""

__author__ = 'Victor Olaya'
__date__ = 'April 2014'
__copyright__ = '(C) 2014, Victor Olaya'
__date__ = 'February 2015'
__copyright__ = '(C) 2012-2015, Victor Olaya'

# This will get replaced with a git SHA1 when you do a git archive

Expand Down Expand Up @@ -270,6 +270,7 @@ def processAlgorithm(self, progress):
region = str(self.getParameterValue(self.GRASS_REGION_EXTENT_PARAMETER))
regionCoords = region.split(',')
command = 'g.region'
command += ' -a'
command += ' n=' + str(regionCoords[3])
command += ' s=' + str(regionCoords[2])
command += ' e=' + str(regionCoords[1])
Expand Down Expand Up @@ -354,11 +355,11 @@ def processAlgorithm(self, progress):

# Raster layer output: adjust region to layer before
# exporting
commands.append('g.region rast=' + out.name + uniqueSufix)
outputCommands.append('g.region rast=' + out.name
commands.append('g.region raster=' + out.name + uniqueSufix)
outputCommands.append('g.region raster=' + out.name
+ uniqueSufix)
if self.grassName == 'r.composite':
command = 'r.out.tiff -t --verbose'
command = 'r.out.tiff -t --verbose' # FIXME r.out.tiff deprecated, use r.out.gdal
command += ' input='
command += out.name + uniqueSufix
command += ' output="' + filename + '"'
Expand Down
15 changes: 7 additions & 8 deletions python/plugins/processing/algs/grass7/Grass7Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
***************************************************************************
GrassUtils.py
---------------------
Date : April 2014
Copyright : (C) 2014 by Victor Olaya
Date : February 2015
Copyright : (C) 2014-2015 by Victor Olaya
Email : volayaf at gmail dot com
***************************************************************************
* *
Expand All @@ -18,8 +18,8 @@
"""

__author__ = 'Victor Olaya'
__date__ = 'April 2014'
__copyright__ = '(C) 2014, Victor Olaya'
__date__ = 'February 2015'
__copyright__ = '(C) 2014-2015, Victor Olaya'

# This will get replaced with a git SHA1 when you do a git archive

Expand Down Expand Up @@ -207,12 +207,11 @@ def createTempMapset():
'QGIS GRASS GIS 7 interface: temporary data processing location.\n')
outfile.close()

# FIXME: in GRASS 7 the SQLite driver is default (and more powerful)
Grass7Utils.writeGrass7Window(os.path.join(folder, 'PERMANENT', 'WIND'))
mkdir(os.path.join(folder, 'PERMANENT', 'dbf'))
mkdir(os.path.join(folder, 'PERMANENT', 'sqlite'))
outfile = open(os.path.join(folder, 'PERMANENT', 'VAR'), 'w')
outfile.write('DB_DRIVER: dbf\n')
outfile.write('DB_DATABASE: $GISDBASE/$LOCATION_NAME/$MAPSET/dbf/\n')
outfile.write('DB_DRIVER: sqlite\n')
outfile.write('DB_DATABASE: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db\n')
outfile.close()

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass7/nviz7.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def exportVectorLayer(self, layer):
destFilename = self.getTempFilename()
command = 'v.in.ogr'
command += ' min_area=-1'
command += ' dsn="' + os.path.dirname(layer) + '"'
command += ' input="' + os.path.dirname(layer) + '"'
command += ' layer=' + os.path.basename(layer)[:-4]
command += ' output=' + destFilename
command += ' --overwrite -o'
Expand Down

0 comments on commit b1a2ccd

Please sign in to comment.