Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
124 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
file(GLOB PY_FILES *.py) | ||
file(GLOB YAML_FILES *.yaml) | ||
|
||
PLUGIN_INSTALL(sagaprovider ./shorthelp/ ${PY_FILES}) | ||
PLUGIN_INSTALL(sagaprovider ./shorthelp/ ${YAML_FILES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
*************************************************************************** | ||
__init__.py | ||
--------------------- | ||
Date : January 2016 | ||
Copyright : (C) 2016 by Victor Olaya | ||
Email : volayaf at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* 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__ = 'Victor Olaya' | ||
__date__ = 'January 2016' | ||
__copyright__ = '(C) 2016, Victor Olaya' | ||
|
||
import os | ||
import codecs | ||
import warnings | ||
|
||
with warnings.catch_warnings(): | ||
warnings.filterwarnings("ignore", category=DeprecationWarning) | ||
import yaml | ||
|
||
from qgis.core import QgsSettings, Qgis | ||
from qgis.PyQt.QtCore import QLocale, QCoreApplication | ||
|
||
|
||
def loadShortHelp(): | ||
h = {} | ||
path = os.path.dirname(__file__) | ||
for f in os.listdir(path): | ||
if f.endswith("yaml"): | ||
filename = os.path.join(path, f) | ||
with codecs.open(filename, encoding='utf-8') as stream: | ||
with warnings.catch_warnings(): | ||
warnings.filterwarnings("ignore", category=DeprecationWarning) | ||
for k, v in yaml.load(stream, Loader=yaml.SafeLoader).items(): | ||
if v is None: | ||
continue | ||
h[k] = QCoreApplication.translate("{}Algorithm".format(f[:-5].upper()), v) | ||
|
||
version = ".".join(Qgis.QGIS_VERSION.split(".")[0:2]) | ||
overrideLocale = QgsSettings().value('locale/overrideFlag', False, bool) | ||
if not overrideLocale: | ||
locale = QLocale.system().name()[:2] | ||
else: | ||
locale = QgsSettings().value('locale/userLocale', '') | ||
locale = locale.split("_")[0] | ||
|
||
def replace(s): | ||
if s is not None: | ||
return s.replace("{qgisdocs}", "https://docs.qgis.org/%s/%s/docs" % (version, locale)) | ||
else: | ||
return None | ||
|
||
h = {k: replace(v) for k, v in list(h.items())} | ||
|
||
return h | ||
|
||
|
||
shortHelp = loadShortHelp() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
saga:rastercalculator: > | ||
This algorithm allows performing algebraic operations on raster layers | ||
|
||
It requires a base layer, and a set of additional layers. The base layer is identified as "a" in the formula, while the additional layers are identified as "b, c, d...", using the order in which they appear in the multiple selection dialog. | ||
|
||
The resulting layer has the extent and cell size of the main layer. | ||
|
||
The following operators and functions are available. | ||
|
||
- Addition (+) | ||
|
||
- Subtraction ( - ) | ||
|
||
- Multiplication (*) | ||
|
||
- Division (/) | ||
|
||
- Power (^) | ||
|
||
- ln(x): returns natural logarithm of x. | ||
|
||
- sin(x): returns the sine of x. x must be in radians | ||
|
||
- cos(x): returns the cosine of x. x must be in radians | ||
|
||
- tan(x): returns the tangent of x. x must be in radians | ||
|
||
- asin(x): returns the arcsine of x, in radians | ||
|
||
- acos(x): returns the arccosine of x, in radians | ||
|
||
- atan(x): returns the arctangent of x, in radians | ||
|
||
- atan2(x,y): returns the arctangent y/x, in radians | ||
|
||
- abs(x): return the absolute value of x. abs(- 5)=5 | ||
|
||
- int(x): returns the integer part of x. int(5.4)=5 | ||
|
||
- mod(x,y): returns the modulus of x/y. mod(7,4)=3 | ||
|
||
- gt(x,y): true if x is greater than y | ||
|
||
- lt(x,y): true if x is lower than y | ||
|
||
- eq(x,y): true if x equals y. When using this function SAGA evaluates it in a per–cell basis. Therefore, eq(a,b) will not return 1 if grid a equals grid b. It will return 1 for those cells that have the same value in both grids, and zero otherwise. | ||
|
||
- ifelse(condition, x, y) returns x if condition evaluates to true (condition=1) or y if it evaluates to false |