This is a subclass of QgsProcessingParameterNumber, but specifically
for numeric parameters which represent distances. It is linked
to a parent parameter, from which the distance unit will
be determined, and is shown using a dedicated distance widget
within the processing parameters panel. This widget shows
the distance unit.
This avoids the confusion when running algorithms which
use distances where the unit depends on a layer or CRS parameter -
e.g. the distance parameter in the buffer algorithm gives
the distance in layer units... so now we can show those units
directly within the dialog. Hopefully this leads to less
user confusion and accidental "1000 degree buffers"!
Additionally - if the unit is in degrees, a small warning
icon is shown next to the parameter. The tooltip for this
icon advises users to reproject data into a suitable
projected local coordinate system.
Initially implemented for the native buffer and single
sided buffer algorithm only - but more will be added.
Fixes#16290
In some cases it is useful to add extra information to the symbols in the legend.
This work allows definition of additional labels in vector layer properties > Legend tab.
Required layers are not allowed to be removed from the project.
This adds extra safety to protect project users from removing layers
they may think are not needed (e.g. used in joins, relations, expressions).
Users can set/unset layers that are required in project properties dialog.
Each map theme will also record which layers, groups and legend items are expanded,
so when a map theme is selected, the expanded/collapsed states get applied in the layer tree.
Adds a new "feature filter" algorithm. This algorithm takes a list of expressions and
creates an output for each of them. Matching features from the input layer are sent
to the outputs.
This allows for an algorithm to only handle a subset of incoming features or to send
different features to different outputs.
The algorithm is only available in the modeler.
Previously QgsSvgCache would often try to fetch remote images
using a network request on the main thread, by calling
processEvents repeatedly until the request was complete.
This caused lots of bugs, since the main thread processEvents
would proceed with all kinds of stuff assuming that the
svg fetch operation was complete, leading to frequent crashes
and deadlocks and making remote svg use impossible (it's
likely that the SVG cache remote fetching code was written
in the pre-multi-threaded rendering era).
There's no way to fix this with async svg fetching - we
HAVE to remove the processEvents call, and a QEventLoop
won't help either (since the method may be called on the
main thread). Accordingly the only solution is to
fetch the requested svg in the background, and return
a temporary "downloading" svg for use in the meantime.
We use a QgsNetworkContentFetcherTask to do this, so it's
nicely integrated with task manager.
A request task is fired up when a remote svg is requested
for the first time, with the temporary downloading svg
returned for use by the caller asynchronously. QgsSvgCache
then emits the remoteSvgFetched signal when a previously
requested remote SVG has been successfully fetched,
triggering a map canvas redraw with the correct SVG
graphic.
Fixes#18504
create expression context scopes
Allows algorithms which require the underlying layer scope
to operate correctly when running in selected features only
mode.
Fixes#17170
in a feature-based algorithm, don't try to continue processing
remaining features
Avoids multiple error dialogs appearing for every feature
in a layer...
Because Python code cannot catch and rethrow c++ exceptions
without losing context, we end up getting unknown exceptions
caught by c++ from python code (phew!).
So if we catch a python exception from processing, throw it
into the log so at least there's the full debugging detail
available on the console.
(Not ideal. Would love to see a PR allowing the full error
message to be passed correctly between c++/python/back again)
Allows algorithms to pre-processes a set of parameters, allowing the
algorithm to clean their values.
This method is automatically called after users enter parameters, e.g.
via the algorithm dialog. This method should NOT be called manually
by algorithms.
Also:
- move doxygen comments to header files so that they get included
in Python docstrings
- remove duplicate doxygen implemented in both header and footer
- remove some redundant doxygen for overridden methods
- add some missing docs