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.
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.
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
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.
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.
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
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.