7161 Commits

Author SHA1 Message Date
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
Alessandro Pasotti
8fb112d26f [db-manager] Invalidate sqlite connection if it was created in another thread
Fixes #21028 - DB manager: SQLite objects created in a thread can only be used in that same thread
2019-03-11 16:04:00 +01:00
Etienne Trimaille
fa843f8705 drop old processing provider example which is not compatible QGIS 3 2019-03-11 09:38:23 +10:00
Giovanni Manghi
7aa7248b97 Better GRASS r.series description to help workaround a limitation of Processing 2019-03-11 09:22:02 +10:00
Alexander Bruy
8b621b6997 [feature][processing] expose GDAL pansharpening tool in the Processing 2019-03-11 08:48:02 +10:00
Alexander Bruy
0fcf567fb0 [processing] fix handling of the multiple layers parameter when inputs
are plain files
2019-03-11 08:29:03 +10:00
Nyall Dawson
82b186f00f [processing] Allow data type for numeric inputs to be specified 2019-03-11 08:05:07 +10:00
Nyall Dawson
9f6ddaf5c5 Fix qt warning on modeler algorithm edit 2019-03-11 08:05:07 +10:00
Nyall Dawson
cf43446885 [processing] Show parameter type in input definition dialog title 2019-03-11 08:05:07 +10:00
Nyall Dawson
b66b944535 [FEATURE][processing] New Raster Boolean logical OR/AND algorithms
These algorithms calculate the boolean OR or AND for a set of input
rasters. For AND, if all of the input rasters have a non-zero value
for a pixel, that pixel will be set to 1 in the output raster, otherwise
it will be set to 0. For OR, if ANY of the input rasters have a non-zero
value for a pixel, that pixel will be set to 1 in the output raster,
else 0.

A reference layer parameter specifies an existing raster layer to use
as a reference when creating the output raster. The output raster will
have the same extent, CRS, and pixel dimensions as this layer

By default, a nodata pixel in ANY of the input layers will result in
a nodata pixel in the output raster. If the 'Treat nodata values
as false' option is checked, then nodata inputs will be treated the
same as a 0 input value.

Makes for much simpler raster boolean logic calculation without
the complexity of using the raster calculator (and that's not
always possible to do anyway, e.g. when ANY of the input rasters
has a nodata pixel). It's also scalable dynamic to any number of
input rasters (unlike raster calc), so is more flexible when
used within models.
2019-03-11 07:45:44 +10:00
Matthias Kuhn
7ceb97aec6
Merge pull request #9456 from Gustry/pyqt
replace some PyQt5 to qgis.PyQt
2019-03-10 12:08:07 +01:00
Matthias Kuhn
312473c4dd
Update python/plugins/MetaSearch/util.py
Co-Authored-By: Gustry <gustrimaille@yahoo.fr>
2019-03-10 06:34:10 -04:00
Matthias Kuhn
a91ecd534c
Merge pull request #9444 from NaturalGIS/gdal_fix_improve_gdal_clip_raster_by_mask
Fixes/improves the GDAL clip by mask layer tool
2019-03-10 10:35:13 +01:00
Etienne Trimaille
2076ca4fe0
replace some PyQt5 to qgis.PyQt 2019-03-09 22:45:51 -04:00
Alexander Bruy
80dd6d5203 [processing] add missed imports to batch panel (fix #21486) 2019-03-09 20:34:15 +02:00
Giovanni Manghi
78cc5b2bf5 Fixes/improves the GDAL clip by mask layer tool: removes a an option (-te) that does not make sense for the clip by mask, and adds the option to allow choose the output resolution 2019-03-09 11:46:26 +00:00
Nyall Dawson
cccf974211 [processing] Port enum widget wrapper to new API
Fixes:
- enum parameters set to "allow multiple" only allow a single
value selection when used in modeler
- optional enum parameters cannot be set to no value when
used outside of modeler

Fixes #20406
2019-03-08 15:46:59 +10:00
lbartoletti
f87c447d34 Add FreeBSD for SagaUtils 2019-03-07 08:48:23 +10:00
Juergen E. Fischer
be6c0738a4 fix 9f1fcb72d4 2019-03-05 23:14:43 +01:00
Nyall Dawson
8bef710cea [processing][saga] Difference and symmetric difference algorithms have known issues in SAGA LTR 2019-03-06 06:33:06 +10:00
Nyall Dawson
63d648738d [processing][needs-docs] By default, hide algorithms with known issues from toolbox
And add a Processing setting to allow these to be shown. When shown, they
are highlighted in red with a tooltip explaining that the algorithm
has known issues
2019-03-06 06:33:06 +10:00