Skip to content
Permalink
Browse files

Merge pull request #36645 from alexbruy/r-tileset

fix r.tileset Processing GRASS algorithm
  • Loading branch information
alexbruy committed May 25, 2020
2 parents 97d0988 + 683f69c commit a20fe6f5273e77a885b0e96250509377fd4b70d4
@@ -42,6 +42,7 @@
QgsProcessingAlgorithm,
QgsProcessingParameterDefinition,
QgsProcessingException,
QgsProcessingParameterCrs,
QgsProcessingParameterExtent,
QgsProcessingParameterEnum,
QgsProcessingParameterNumber,
@@ -633,6 +634,9 @@ def processCommand(self, parameters, context, feedback, delOutputs=False):
continue
else:
value = '{},{}'.format(v[0], v[1])
elif isinstance(param, QgsProcessingParameterCrs):
if self.parameterAsCrs(parameters, paramName, context):
value = '"{}"'.format(self.parameterAsCrs(parameters, paramName, context).toProj())
# For everything else, we assume that it is a string
else:
value = '"{}"'.format(
@@ -11,4 +11,4 @@ QgsProcessingParameterNumber|overlap|Number of cells tiles should overlap in eac
QgsProcessingParameterString|separator|Output field separator|pipe|False|True
*QgsProcessingParameterBoolean|-g|Produces shell script output|False
*QgsProcessingParameterBoolean|-w|Produces web map server query string output|False
QgsProcessingParameterFileDestination|output|Tileset|Txt files (*.txt)|None|False
QgsProcessingParameterFileDestination|html|Tileset|HTML files (*.html)|None|False
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
r_proj.py
---------
Date : October 2017
Copyright : (C) 2017 by Médéric Ribreux
Email : medspx at medspx dot fr
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************
"""

__author__ = 'Médéric Ribreux'
__date__ = 'October 2017'
__copyright__ = '(C) 2017, Médéric Ribreux'


def processOutputs(alg, parameters, context, feedback):
crs = alg.parameterAsCrs(parameters, 'sourceproj', context)

alg.commands.insert(0, 'g.proj -c proj4="{}"'.format(crs.toProj()))
@@ -0,0 +1 @@
1.0|0.0|1.0|1.0|1|2
@@ -1595,3 +1595,22 @@ tests:
rules:
- '1|1|0|344550|6693650|344550|6693650'
- '1|3|100|352650|6693650|352750|6693650'

- algorithm: grass7:r.tileset
name: GRASS 7 r.tileset
params:
-g: false
-w: false
destscale: 1.0
maxcols: 1024
maxrows: 2048
overlap: 0
separator: pipe
sourceproj: EPSG:4326
sourcescale: 1.0
results:
html:
name: expected/grass7/r_tileset.html
type: regex
rules:
- '1.0|0.0|1.0|1.0|1|2'

0 comments on commit a20fe6f

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