7130 Commits

Author SHA1 Message Date
Alexander Bruy
c706cdeb06 [processing] ensure that output temporary directory exists (fix #21701) 2019-04-20 11:53:47 +03:00
Matthias Kuhn
8416e7588c
Merge pull request #9781 from m-kuhn/processing_parameter_as_boolean
Add QgsProcessingAlgorithm::parameterAsBoolean
2019-04-17 09:20:07 +02:00
Alessandro Pasotti
ac04339434 Pass transform context to raster calculator 2019-04-17 10:06:41 +10:00
Alessandro Pasotti
0d7841a0d8 Fix grass alg combineLayerExtents 2019-04-17 10:06:41 +10:00
Nyall Dawson
b6bc1ee2d4 Tweak QgsProcessingUtils::combineLayerExtents for future proofing, remove deprecated usage 2019-04-17 10:06:41 +10:00
Matthias Kuhn
b90a01847f
Prefer parameterAsBoolean over parameterAsBool 2019-04-16 08:30:00 +02:00
Juergen E. Fischer
891ea18bab debian packaging: add ubuntu disco 2019-04-15 23:38:20 +02:00
nirvn
9ce1093bce [FEATURE][ogr] Add string list field type support 2019-04-10 08:06:12 +07:00
Nyall Dawson
933559b655 [processing] Report provider version string alongside QGIS version in log
Helpful for debugging and reproducability of results
2019-04-08 16:59:15 +10:00
nirvn
5e0fd15570 [FEATURE][processing] Add concatenate_unique support to the aggregate alg 2019-04-05 12:01:06 +07:00
Juergen E. Fischer
f1dbcc3c53 processing: fix grass' r.quantile parameter (fixes #21751) 2019-04-04 16:46:37 +02:00
Nyall Dawson
59ed07891a Also store x/y coordinates of nearest points on features when calculating
nearest features

This can be useful, and is difficult to calculate later!
2019-04-03 02:31:03 +10:00
Nyall Dawson
95af4d4a45 [FEATURE] New Processing algorithm "Join attributes by nearest"
K-nearest neighbour joins from the Processing toolbox!

This algorithm takes an input vector layer and creates a new
vector layer that is an with additional attributes in its attribute table
The additional attributes and their values are taken from a second
vector layer, where features are joined by finding the closest features
from each layer.

By default only the single nearest feature is joined, but optionally
the join can use the n-nearest neighboring features instead.

If a maximum distance is specified, then only features which are
closer than this distance will be matched.
2019-04-03 02:31:03 +10:00
Nyall Dawson
39a255c1b9 [processing] Use null instead of nan for invalid stat values in join by location summary 2019-04-02 06:17:56 +10:00
Nyall Dawson
7bf9279a53 [processing] Fix invalid reprojection in join by location (summary) 2019-04-02 06:17:56 +10:00
Nyall Dawson
7674e1657b [processing] Include version information at start of log
Start the log text with QGIS/Qt/GEOS/GDAL version information strings.
This is helpful for debugging and accountability.
2019-04-02 06:16:45 +10:00
volaya
165ab8b25f [processing] do not export input sdat files 2019-03-30 11:02:25 +10:00
Nyall Dawson
f5a3485eae Fix some Python warnings, avoid accidently hiding all deprecation warnings 2019-03-28 11:47:23 +10:00
Nyall Dawson
234c1718c4 Mark some Processing methods as deprecated 2019-03-28 11:47:23 +10:00
Nyall Dawson
7aca208522 Update processing script template 2019-03-28 11:47:23 +10:00
Nyall Dawson
f758d8b282 Ensure all public, stable API methods for Processing have nice docstrings 2019-03-28 11:47:23 +10:00
Nyall Dawson
7e80fc8391 Drop isWindows/isMac from stable Processing API 2019-03-28 11:47:23 +10:00
Nyall Dawson
64387a2254 [needs-docs][processing] Monkey patch stable external Processing API into qgis.processing
Instead of encouraging use of the internal Processing modules
(e.g. from processing.tools.general import run , import processing, ...)
instead expose all Python specific STABLE processing additions
to the qgis.processing module.

Instead, scripts and plugins should now use

from qgis.processing import run, algorithmHelp,...

This makes a clear distinction between internal Processing python
modules (i.e., everything else!) and the parts of Processing
which are stable and designed to be used by plugins and scripts.

TODO: QGIS 4.0 -- move the internal Processing plugin modules
to __processing, to clearer indicate that this is all internal
stuff.
2019-03-28 11:47:23 +10:00
Nyall Dawson
ef8d893393 More QgsMapLayer python fixes 2019-03-27 09:11:15 +10:00
Nyall Dawson
ac651ee0d9 Followup 8d51a693, fix broken plugins 2019-03-27 07:20:43 +10:00
Denis Rouzaud
8d51a693a1 missing changes of QgsMapLayer::Type => QgsMapLayerType 2019-03-26 14:09:19 -05:00
Juergen E. Fischer
0c23e94a29 fix translation string 2019-03-23 20:53:31 +01:00
Víctor Olaya
e0a990d997 [processing] Add 'call' statements to SAGA batch file 2019-03-22 12:15:50 +10:00
Giovanni Manghi
10a542ebdf fixes GRASS r.mapcalc tool 2019-03-22 07:29:53 +10:00
Nyall Dawson
af06cf0cd2 [processing] Fix exception when creating unit tests 2019-03-21 16:08:42 +10:00
Nyall Dawson
c7ac86604f [FEATURE] New algorithm "Add X/Y fields to layer"
Adds X and Y (or latitude/longitude) fields to a point layer.
The X/Y fields can be calculated in a different CRS to the
layer (e.g. creating latitude/longitude fields for a layer in
a project CRS).

Sponsored by SMEC/SJ
2019-03-21 16:08:42 +10:00
Nyall Dawson
c66159bd2d [processing] Fix warning when loading algorithm dialog and no layers
are present

Fixes #21631
2019-03-21 15:10:30 +10:00
Rashad Kanavath
46da10a1e8 Revert "fixes #21374: ignore optional output parameters"
This reverts commit af2421541c78742a233b3c5a00cbbd6c11ceaaab.
2019-03-21 04:44:59 +10:00
Rashad Kanavath
91d430a0cb fix travis code_layout test 2019-03-21 04:44:59 +10:00
Rashad Kanavath
e94d9a596a [TEST] add more test on otb segmentation apps
Even though not all errors are caught by these new tests, it could
expose if otb is broken or if processing api is changed to adopt
optional status of parameters at run-time.

`alg.processAlgorithm()` is running and failing correctly.
But `parameter.checkValueIsAcceptable()` and `alg.checkParameterValues()`
aren't working as expected.
2019-03-21 04:44:59 +10:00
Rashad Kanavath
0b86110ccd report warnings as non fatal errors through Feedback 2019-03-21 04:44:59 +10:00
Rashad Kanavath
c763b9229b fix #21373 #21374: handle update optional status based on user-input
Parameters are marked required in descriptor file for certian
applications but they are only required if a parent parameter has a
"certain" value. So initial idea was to make all of those parameters
optional from OTB part. So that qgis can work correctly and was a easy
fix. But.. we (me and Antonie) decided not to take that route and
found a better fix.

`OtbParameterChoice` and its wrapper will update optional status of
all sub-parameters depending on the value of a choice parameter.

A test has been added to check this issue and will be available in
next commit.
2019-03-21 04:44:59 +10:00
Rashad Kanavath
f6ad4745bd fixes #21374: ignore optional output parameters 2019-03-21 04:44:59 +10:00
Rashad Kanavath
f1cc8aa108 bug: check for empty string in parameter values 2019-03-21 04:44:59 +10:00
Rashad Kanavath
d3a1c65368 Remove OtbSettings class and put constants for key names in OtbUtils 2019-03-21 04:44:59 +10:00
Rashad Kanavath
07d17a0f17 This commits fixes encoding issue on windows.
getWindowsCodePage is taken from Grass7Utils.py

Instead of writing a cli_file at startup, provider now pass all
required env_variables directly to subprocess.popen. This has known to
cause issues when handling with windows path names. subprocess.Popen
handles it correctly depending on platform

Logging of output from otbalgorithm and updating progress bar is
slightly updated.
Algoirthm is now launched directly using otbApplicationLauncherCommandLine
`encoding` (on windows) and env arguments passed to subprocess is
logged in QgsMessageLog
2019-03-21 04:44:59 +10:00
Nyall Dawson
a38e9e66fc [processing] Fix layerName= suffix is incorrectly passed to SAGA algorithms
Fixes #21569
2019-03-18 18:24:02 +10:00
Nyall Dawson
719a225bca [processing] Port point widget wrapper to new API
And switch to a snapping canvas tool when selecting points from canvas
2019-03-17 16:19:40 +10:00
Nyall Dawson
95930ed68c [processing] Fix IDW parameter value creation 2019-03-15 08:38:01 +10:00
Nyall Dawson
c24f51ece8 [processing] Fix exception in IDW interpolation
Fixes #21578
2019-03-15 08:38:01 +10:00
Nyall Dawson
db1645cf12 [processing] Fix processing.runAndLoadResults
Fixes #21551
2019-03-15 08:37:43 +10:00
Nyall Dawson
32fbf0a92b [processing][FEATURE] New parameter type for map scales
This adds a new parameter type specifically for map scales,
QgsProcessingParameterScale. The values are evaluated using
self.parameterAsDouble, which returns the map scale
denominator (matching the standard in other parts of the
QGIS API).

Scale parameters are displayed to users using the standard
QgsScaleWidget, which includes the combo box of predefined
scales and a shortcut button to match the current map scale.
2019-03-13 16:52:29 +10:00
Nyall Dawson
021d1ef237 [FEATURE][processing] New parameter types for layouts and layout items
Allows processing algorithms which operate on a specific layout
and layout item selection
2019-03-12 08:16:52 +10:00
Nyall Dawson
5ec43cfdc1 [processing] Add project to QgsProcessingParameterWidgetContext 2019-03-12 08:16:52 +10:00
Alessandro Pasotti
8e39f0f57a
Merge pull request #9478 from elpaso/bugfix-21028-db-manager-sqlite-thread
[db-manager] Invalidate sqlite connection if it was created in anothe…
2019-03-11 21:28:43 +01:00