675 Commits

Author SHA1 Message Date
Alexander Bruy
a1ec95cf70
Merge pull request #61542 from boardend/content_cache_invalidatate
Add invalidateCacheEntry() for QgsAbstractContentCache implementations
2025-05-05 10:43:33 +01:00
Nyall Dawson
72ad735b1e [api] Add QgsSipUtils, with method to test if object is owned by Python
QgsSipUtils.isPyOwned will return True if an object is owned
by python, or False if ownership is held by another object
or c++ class.

This gives a way to test in advance if we can safely assign
an object to a method which takes ownership (which always results
in a crash).
2025-05-05 07:15:43 +10:00
Nyall Dawson
f1b8682e36 Improve API for exporting to SLD
Deprecate old methods and make methods always take QgsSldExportContext.
Add capacity to QgsSldExportContext to collect export errors and
warnings.

The old API had no way to reliably report errors/warnings during
export to users.
2025-05-04 17:55:25 +10:00
Michael Schmuki
1672330cdc Add invalidateCacheEntry() for QgsAbstractContentCache implementations 2025-05-02 11:59:09 +02:00
Nyall Dawson
6bd91f8381 [processing][api] Add API for an algorithm to auto-set parameter values
Adds an API which an algorithm can implement to support auto-setting
parameter values. This is designed to handle the case
of eg an algorithm which does a file format translation, where
it's desirable to default the output parameter value to an input
parameter value with a different extension.

This can now be done by implementing autogenerateParameterValues
in the algorithm, eg:

    def autogenerateParameterValues(self, existingParameters, changedParameter, mode):
        if changedParameter == self.INPUT:
            input_file = existingParameters.get(self.INPUT)
            if input_file:
                input_path = Path(input_file)
                if input_path.exists():
                    # auto set output parameter to same as input but with 'qgs' extension
                    return {self.OUTPUT: input_path.with_suffix('.qgs').as_posix()}

        return {}

Works for both toolbox and batch modes for algorithms
2025-04-30 13:56:09 +10:00
Nyall Dawson
31ac029d0a Move processing dialog mode enum to Qgis and rename 2025-04-30 13:56:09 +10:00
Valentin Buira
f56f85dc7c
Add basic drag and drop support in the model designer (#60664) 2025-04-30 09:47:48 +10:00
Nyall Dawson
c2ee323793 [feature] Add labeling setting to prevent duplicate labels within xx mm
Improves the appearance of labels in situations like road networks,
where things like dual carriageways, service roads, etc can result
in many labels of the exact same text appearing close to each other.

When active, removes any labels with the exact same text (case
sensitive!) which are closer then this minimum distance.

The setting applies across layers, so duplicate text from ANY
layer will be considered.
2025-04-22 11:45:25 +10:00
Nyall Dawson
4d98f21d67 [feature] Add 'margin around labels' setting for labeling
Allows setting a margin around a layer's labels, which prevents
other labels from being placed closer than this margin distance
to the layer's labels.
2025-04-22 11:45:25 +10:00
Matthias Kuhn
6aac924cc2
Merge pull request #60134 from btzy/codearg
Open and load --code file and --py-args arguments in C++
2025-04-21 19:52:14 +02:00
Nyall Dawson
2925f42dfa
Add optimised method to fill a QgsRasterBlock with a constant value 2025-04-16 14:35:25 +10:00
Bernard Teo
c55a567070
Open and load --code file in C++ 2025-04-16 00:30:00 +08:00
Nyall Dawson
0e6d5f5593 Properly silence overloaded-virtual warning on Fedora 42 2025-04-12 06:38:32 +10:00
Nyall Dawson
fb645f0e04 Fix another documentation build warning 2025-04-09 14:04:24 +10:00
Nyall Dawson
e5327c3749 Fix build error for PyQGIS docs
Correctly convert typehints for c++ pointer arguments
2025-04-09 14:04:24 +10:00
Nyall Dawson
1e1c415261 Allow data-defined control over legend wrap distance 2025-04-09 13:09:36 +10:00
Nyall Dawson
71420a5628 Cleanup global constants
- Deprecate global geographic crs strings, these should not be used
- Move some global constants to Qgis, and monkey patch for
  API compatibility
- Deprecate global qgsVsiPrefix. Use QgsGdalUtils::vsiPrefixForPath()
  instead
2025-04-03 11:44:59 +10:00
Nyall Dawson
a9fc31921e No need to use string for bool type 2025-04-03 01:05:31 +10:00
Nyall Dawson
9435a84ff7 sipify 2025-04-03 01:05:31 +10:00
Alexander Bruy
34aedd067d
Merge pull request #60710 from GispoCoding/59494_merge_policies
Add merge policies
2025-04-02 09:22:52 +01:00
Nyall Dawson
3f6b490218 Sipify 2025-04-02 11:11:10 +10:00
Nyall Dawson
fd6429e666 [api] Methods to create geocentric CRS from ellipsoid/other crs
Adds:

- QgsCoordinateReferenceSystem::createGeocentricCrs, which takes
an ellipsoid acronym and builds a matching geocentric CRS
- QgsCoordinateReferenceSystem::toGeocentricCrs, which takes
an existing CRS and returns a corresponding geocentric CRS with
the same datum/datum ensemble
2025-04-01 20:05:56 +10:00
Nyall Dawson
a3dd421f16 Clarify units 2025-04-01 20:05:56 +10:00
Nyall Dawson
29050007d7 Fix class documentation which starts with "this is..."/"a class..." etc 2025-03-30 20:48:07 +10:00
Nyall Dawson
9ea131ded2 [api] Add scale calculation method for "scale at equator"
Always calculates the scale at the equator, regardless of the
actual visible map extent.

This method can be used to provide a consistent, static scale for
maps in geographic reference systems, regardless of the latitudes
actually visible in the map (permitting consistent appearance of
these maps when rendering relies on scale based visibility or
calculations). Otherwise a project in eg EPSG:4326 which uses
scale based visibility of layers and symbols will see layers
and features "randomly" disappear as the map is panned, even
though the user has not zoomed in or out of the map.

This method is only applicable when calculating scales with a
degree based reference system.
2025-03-30 18:03:30 +10:00
Nyall Dawson
a2db8cf453 Add QgsProject setting for scale calculation method
Exposes the same methods as are available for layout scale bars,
and can be set for a particular project in the project properties
dialog
2025-03-30 18:03:30 +10:00
Mathieu Pellerin
e75a28f15a [editor widget] Fix relation reference widget filter expression's handling of current(_parent)_* variables and functions 2025-03-29 16:06:09 +07:00
qgis-bot
f2f0de0bc5 auto sipify 🍺 2025-03-28 21:58:29 +00:00
Nyall Dawson
39e37e1fc5 Unify QgsMeshUtils into a single utility class
This was previously a namespace split over multiple files
2025-03-29 07:55:27 +10:00
Nyall Dawson
d991480cbe Fix broken emphasis tag warning when building PyQGIS docs 2025-03-28 13:07:03 +10:00
Nyall Dawson
7b56629478 Sipify 2025-03-27 14:00:26 +10:00
Jean Felder
9eb3c37400 qgsprofilerenderer: Introduce a default symbol for subsections
This will be used in the next commit.
2025-03-25 09:47:50 +10:00
Martin Dobias
c40d25ade9 Add 3D scene mode enum 2025-03-24 10:29:33 +01:00
Martin Dobias
e98bf79f1a Initial implementation of globe camera controller
This is a new navigation mode for QgsCameraController which is meant to work
just like the terrain-based navigation mode, but for 3D scenes with globe.

Initially, the new navigation mode can handle:
- zooming in/out with mouse wheel
- orbit around globe when dragging with left mouse button pressed
- left/right/up/down keys to orbit around globe
- shift + left/right keys to change heading angle
- shift + up/down keys to change pitch angle
- page up/page down keys to increase/decrease elevation

For camera pose, we use QgsCameraPose as for "flat" scenes, but the QCamera
is positioned/rotated slightly differently - the main change is that in case
of globe, we use ECEF coordinates of the camera pose's center point, convert
them to lat/lon coordinates in order to set up initial rotation of the camera
so that it is perpendicular to the tangent plane at the given ECEF coordinate.
2025-03-24 10:29:33 +01:00
Nyall Dawson
b9b519950d [api] Add advanced network request preprocessor capabilities
Allows mutating the request, network operation and request data.

Intended for mocking eg post requests in unit tests
2025-03-24 10:25:39 +10:00
Julien Cabieces
716af56b62 doc(RasterTemporal): fix documentation 2025-03-14 10:19:50 +10:00
Julien Cabieces
545e14350b feat(RasterTemporal): Add fixed date/time to raster temporal mode 2025-03-14 10:19:50 +10:00
Nyall Dawson
a2f9868f6f
Remove duplicate http method enums 2025-03-12 11:10:57 +10:00
Nyall Dawson
8fdd39fca9 Add support for setting output fields for QgsVectorLayerExporter
Allows remapping fields from the source fields, including specifying
the exact output field type, and source expression
2025-03-12 10:25:48 +10:00
Nyall Dawson
e17d9f722b
Add more flexible API variant for QgsVectorLayerExport.exportLayer 2025-03-10 14:41:20 +10:00
Nyall Dawson
56bc177e4e Add provider connection method to set table comment
Currently supported for Postgres provider only
2025-03-10 14:40:27 +10:00
Nyall Dawson
d5a812e3d4 Add metadata methods for primary key capabilities 2025-03-10 14:40:27 +10:00
Nyall Dawson
b1727f8b73 [api] Add connection metadata methods for default geometry column name, import capabilities 2025-03-10 14:40:27 +10:00
Nyall Dawson
9fa19f8098 Create QgsAbstractDatabaseProviderConnection::createVectorLayerExporterDestinationUri
Creates a URI for use with QgsVectorLayerExporter corresponding to given destination
table options for the backend. The URI format and extra options which
need to be passed to QgsVectorLayerExporter differ from provider to
provider, so this new method gives us a consistent, generic method we
can call to safely generate the right URI and options in a
cross-provider way.

Implemented for all database connection providers.
2025-03-10 14:40:27 +10:00
Nyall Dawson
13aae162f0 Promote marker symbol alignment enums to enum class, move to Qgis 2025-03-05 19:02:47 +10:00
signedav
222f2c61b1 Introducing new VectorAnchorPoint Baseline to align font markers to their baseline. In GUI only exposed to font marker settings. Beautiful VerticalAnchorMode removed because it's an overhead. 2025-03-03 17:12:32 +10:00
signedav
6b5396bd53 introduce VerticalAnchorMode in FontSymbols to have a proper 'hidden' setting for this mode making a differene between legacy and baseline (and future bounds) on the positioning of the characters 2025-03-03 17:12:32 +10:00
Nyall Dawson
bb4827e9f9
Create a class for managing stored database queries
This class is designed to be compatible with DB Manager's storage
of queries in projects, but extended to allow storage within
the local profile too.
2025-02-26 10:54:25 +10:00
Juho Ervasti
2e2a77ac7c SkipAttribute merge policy -> SetToNull 2025-02-25 16:20:38 +02:00
Juho Ervasti
ced40a2d8d Add more policies 2025-02-20 20:12:49 +02:00