22014 Commits

Author SHA1 Message Date
Nyall Dawson
f261855490 Create QgsMapHitTestTask, a QgsTask which executes a legend hit
test in a background thread in a thread-safe way

These legend hit tests can be very expensive to calculate, so
background execution is desirable...
2023-03-08 19:28:18 +10:00
Nyall Dawson
11f5a6947a Refactor QgsMapHitTest to permit thread-safe execution 2023-03-08 19:28:18 +10:00
Nyall Dawson
4647cfccef [processing] Add "Keep disjoint results separate" option to buffer
algorithm

If checked, then any disjoint parts in the buffer results will be
output as separate single-part features. This setting is designed
to expose a similar functionality as is available for the 'dissolve'
algorithm.

Sponsored by City of Canning
2023-03-08 18:08:43 +10:00
Nyall Dawson
3c1e4fe723 [processing] Allow filter expressions to be set for vector sources
This change adds a new "feature filter" option alongside the
existing feature limit and invalid geometry handling options
available for all vector inputs to processing layers.

It allows users to enter an expression to subset the layer dynamically
when running the tool, avoiding the need for separate steps to
set layer filters or create layer subsets.

Sponsored by City of Canning
2023-03-08 16:58:34 +10:00
Nyall Dawson
bb57ef8d1a Doc fixes 2023-03-08 14:53:12 +10:00
Nyall Dawson
781b869a7e [feature][layouts] Support filtering layout legends by multiple linked map items
Instead of limiting layout legend filtering to a single linked map,
this change permits legends to be filtered instead by multiple
linked maps. It is designed to accomodate the use case where
a layout has multiple maps, potentially at different scales
and showing different extents, and a single legend is required
which includes all symbols visible across all the maps.

Sponsored by City of Canning
2023-03-08 14:53:12 +10:00
Nyall Dawson
efbfaf8046 Add QgsFeatureRenderer::legendKeys method to retrieve all legend
keys for the renderer
2023-03-08 14:27:51 +10:00
Nyall Dawson
b170c0f97e Nicer documentation 2023-03-08 14:27:51 +10:00
Yoann Quenach de Quivillic
a1a43e5362 Fixes #49191 make "__file__" available to scripts 2023-03-03 15:57:24 +01:00
Nyall Dawson
06b3678a57 Don't allow users to set maximum thread count for rendering to 1
(This setting can sometimes unwantedly occur when using the same
profile across sessions of newer to very old QGIS versions)

The option is a misleading, as it's actually setting the global
thread limit for the entire QGIS application. If we allow this
to be set to a limit of 1 thread, then deadlocks
occur from the QImage internals in unpredictable ways.
2023-03-03 16:48:34 +10:00
Yoann Quenach de Quivillic
43c415d109 Fix focus switch on close tab 2023-03-03 12:17:01 +10:00
Yoann Quenach de Quivillic
fc3847def7 Fix bug introduced by #51913 - Proxy EditorTab attributes to Editor 2023-03-03 12:17:01 +10:00
Nyall Dawson
edfb9764cb Add API to set field split policy for vector layers 2023-03-01 19:30:39 +10:00
Nyall Dawson
34ed6caaac Add split policy to QgsField 2023-03-01 19:30:39 +10:00
Nyall Dawson
141b9efe44 Expand available values for Qgis::FieldDomainSplitPolicy 2023-03-01 19:30:39 +10:00
Nyall Dawson
723ad914d3
Fix some warnings 2023-02-28 09:01:54 +10:00
Julien Cabieces
8f32f07433 Treat review comments
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
2023-02-27 09:24:40 +01:00
Julien Cabieces
7a2a252d0d fix doc and typos 2023-02-27 09:24:40 +01:00
Julien Cabieces
f8c1c16ec7 fix duplicate layer 2023-02-27 09:24:40 +01:00
Julien Cabieces
b7d800aed2 fix api doc 2023-02-27 09:24:40 +01:00
Julien Cabieces
906757349e fix text renderer tests 2023-02-27 09:24:40 +01:00
Julien Cabieces
b0cce7ac54 don't deprecate a class, sip fails 2023-02-27 09:24:40 +01:00
Julien Cabieces
11e88ad425 fix documentation 2023-02-27 09:24:40 +01:00
Julien Cabieces
5ff9229a8b fix tests 2023-02-27 09:24:40 +01:00
Julien Cabieces
388c6e3ee6 fix project migration of old reference to new ones 2023-02-27 09:24:38 +01:00
Julien Cabieces
7ed58763ed Fix vector rendering of fill symbol layer 2023-02-27 09:23:19 +01:00
Julien Cabieces
b3af80e3e4 [Selective masking]Fixes #34352 : use QUUid to identify symbol layer
Don't use pointers anymore because there are not stable when it comes
to clone
2023-02-27 09:23:16 +01:00
Nyall Dawson
9815333dd4 Fix using interpolated line symbol layer for polygon outlines
It was doing weird things, and silently reverting back to a blue
simple fill
2023-02-27 17:57:55 +10:00
Mathieu Pellerin
22a46d9988 Oh clang 2023-02-27 11:32:38 +10:00
Mathieu Pellerin
16c087f4ab [3d] Expose the 3D map settings for a given scene to python API 2023-02-27 11:32:38 +10:00
Mathieu Pellerin
f188a00df5 [3d] Expose QgsCameraController's rotateCamera() function to API 2023-02-27 11:32:38 +10:00
Mathieu Pellerin
27e2e324ca [3d] Add a walkView() function to QgsCameraController 2023-02-27 11:32:38 +10:00
Denis Rouzaud
238353d380 remove obsolete sip file 2023-02-23 16:07:14 +01:00
Denis Rouzaud
ea53aa3ce2 move settings tree enums to Qgis 2023-02-23 16:07:14 +01:00
Nyall Dawson
84c3613cf7 [processing] Don't raise uncaught exceptions when trying to generate
GDAL commands for invalid layers

This is a partial fix, which at least removes the uncaught exception.
Ideally we'd gracefully fall back to using the layer's source
(even if it doesn't exist!) in the generated GDAL commands. But that's
far from trivial to do.

Fixes #51958
2023-02-23 20:48:04 +10:00
Nyall Dawson
603ccb2904 [processing] Gracefully handle algorithms with no provider set
Fixes #51971
2023-02-23 19:38:45 +10:00
Nyall Dawson
f453d2cc0d [processing] Fix exception when setting output files in batch
processing after removing rows

Fixes #51664
2023-02-23 19:38:11 +10:00
Nyall Dawson
2aa484ca23 Move QgsCameraController enums to Qgis, promote to enum class 2023-02-23 13:53:34 +10:00
Nyall Dawson
176807bc35 Provide a basic way to access open 3d scenes via PyQGIS
Qgs3DMapScene.openScenes() will now return a map of
open Qgs3DMapScene objects (by name) visible in the app. Various
basic properties of the scene are exposed, including
the camera controller, allowing access to navigate 3d
scenes via python
2023-02-23 13:53:34 +10:00
Martin Dobias
289f47690d
Refactor QgsMapLayer's encodedSource()/decodedSource() (#51901)
Conversion between relative and absolute paths when reading/writing project files
has been inconveniently done in subclasses of QgsMapLayer in encodedSource() and
decodedSource() methods, with a lot of provider specific code.

This is a refactoring to finally fix this - there is a new pair of functions added
to QgsProviderMetadata and QgsProviderRegistry:
- absoluteToRelativeUri()
- relativeToAbsoluteUri()

This new pair of functions delegates the actual conversion between absolute and
relative path to provider code - where it belongs.

The existing code from encodedSource() and decodedSource() functions has been moved
to providers. Unit tests were added to confirm the existing behavior.

There should be no change of behavior apart from removal of old compatibility code
for WMS provider for projects from QGIS < 1.9 (10 years ago).
2023-02-22 17:53:44 +10:00
Nyall Dawson
1f6e53b2c4 [metasearch] Fix messed up QgsRubberBand constructor 2023-02-22 12:39:21 +10:00
Nyall Dawson
c6a1a57230 Add some missing documentation 2023-02-22 12:39:21 +10:00
Nyall Dawson
046883fa9c Promote QgsWkbTypes enums to enum class, move to Qgis 2023-02-22 12:39:21 +10:00
Nyall Dawson
ef3c301a34 Fix loss of first color for lineburst symbol layers in GUI
Fixes #51942
2023-02-22 11:32:38 +10:00
Yoann Quenach de Quivillic
9c56921cca Clean up code and fix shortcuts 2023-02-21 14:27:36 +10:00
Yoann Quenach de Quivillic
28146b538a Fix Editor/EditorTab never deleted 2023-02-21 14:27:36 +10:00
Yoann Quenach de Quivillic
7f231099f4 sort imports and cleanup dead code 2023-02-21 14:27:36 +10:00
Nyall Dawson
19b70a634f Use constexpr for max wkt length 2023-02-21 06:01:44 +10:00
Nyall Dawson
18fd0bbbbf Create QgsGeometryWidget
A new widget which stores a referenced geometry value, and provides
handy methods for copying the value as WKT or GeoJSON, pasting
a WKT/GeoJSON value from the clipboard, or clearing the geometry
2023-02-21 06:01:44 +10:00
Nyall Dawson
2dc4d04ac0 Add equality operators for QgsReferencedGeometry 2023-02-21 06:01:44 +10:00