368 Commits

Author SHA1 Message Date
Yoann Quenach de Quivillic
b2f3876e38 Apply suggestions from review 2024-11-14 09:54:48 +10:00
Nyall Dawson
656eb4ccc6 Add AllNumeric value, QGIS 4.0 todo note 2024-11-11 13:01:42 +10:00
Nyall Dawson
c03f550f0f Maintain API 2024-11-11 13:01:42 +10:00
Nyall Dawson
ac23e5d7da Address review 2024-11-11 13:01:42 +10:00
Nyall Dawson
2890df089d [feature] Add raster zonal min/max algorithm
This algorithm extracts point features corresponding to the minimum
and maximum pixel values contained within polygon zones.

The output will contain one point feature for the minimum and one
for the maximum raster value for every individual zonal feature
from a polygon layer.
2024-11-11 13:01:42 +10:00
Nyall Dawson
29b345e2c3 Add scale method option for layout scale bars
Instead of always calculating the scale along the bottom of the
map, expose a choice of methods to the user (along bottom,
middle, top, or average of the three measurements)

For new scalebars, default to the average method, which better
handles the scenario where the scale at the top or bottom of
the map cannot be calculated (eg when the top/bottom of the map
falls just outside valid areas for the map's crs)

This fixes one of the most common scenarios which cause scale
bar widths to blow out to massive sizes

Refs #55240
2024-10-15 12:38:07 +10:00
Nyall Dawson
4c9072e265 Only render main annotation layer in main map canvas or docked maps
Don't show it in other map canvas instances, eg the coordinate
bounds preview map

Fixes #58766
2024-10-11 16:23:37 +10:00
Nyall Dawson
b2d2fc9e28 Optimise text rendering for a common scenario
Reduces a lot of overhead when rendering non-buffered, non-shadowed
text. Cuts render time by ~50% in my testing.

Also introduces a "PreferText" render option, where we default
to using text painting methods in all scenarios where we know
there's no loss in rendering quality to do so. This mode should
become the new default in a future QGIS release, as it is
designed to be faster with no visible rendering differences.

Expand unit testing by covering all text render modes in all
text renderer rendering tests.
2024-10-11 13:32:53 +10:00
Germán Carrillo
490b47daf0 [core] Mark Qgis::SCALE_PRECISION as deprecated, since scale dependent visibility became more robust on range limits (namely, on non-round numbers). 2024-10-08 09:13:34 +10:00
Andrea Giudiceandrea
fefba6c472 Fix typos in QgsUnitTypes 2024-10-07 09:15:30 +02:00
Nyall Dawson
a7a5f972ae Add render context flag to always disable symbol clipping 2024-10-03 12:49:18 +10:00
Nyall Dawson
2fdb2cad80 Add processing algorithm flag for SecurityRisk
And add to "Advanced Python field calculator" algorithm, as that
algorithm uses the Python exec() function and is a security
risk if run with untrusted/unchecked inputs
2024-10-02 10:36:00 +10:00
Denis Rouzaud
eafa4b48b2
fix Python API compatibility (#58860)
* fix Python API compatibility

* Update qgis.h
2024-09-25 07:06:11 +02:00
Even Rouault
eb981cd979 Update RasterColorInterpretation enumeration with constants added in GDAL 3.10
per https://github.com/OSGeo/gdal/pull/10721
2024-09-23 10:11:03 +02:00
Nyall Dawson
3e63b9a4fd Use plural for consistency 2024-09-17 14:00:35 +10:00
Nyall Dawson
0777e7683f Complete EPSG distance unit mapping by adding historic distance units
Ensures we don't perform a lossy conversion of units from the EPSG
CRS database to QGIS units
2024-09-17 14:00:35 +10:00
Nyall Dawson
566b2f7286 Ensure label cache is invalidated when a vector layer renderer
affects the labeling and is re-drawn
2024-09-14 13:25:59 +10:00
Nyall Dawson
c50c923261 Add API to determine if feature renderer affects labeling results 2024-09-14 13:25:59 +10:00
Denis Rouzaud
281726250f
Merge pull request #58354 from gacarrillor/save_functions_in_project
[feature] Allow users to save expression functions in QGIS project file
2024-09-13 17:39:40 +02:00
Alessandro Pasotti
987c38eda6
[auth][api] QgsAuthConfigurationStorage classes and tests (#57992)
Implementation of QEP 
Authentication System: allow Database storage for authentication DB
https://github.com/qgis/QGIS-Enhancement-Proposals/issues/248
2024-09-12 09:18:15 +02:00
Mathieu Pellerin
83e53cb09a Address comment, fix crash seen on Qt6 CI 2024-09-12 08:34:13 +10:00
Mathieu Pellerin
5bcc310768 Address review 2024-09-12 08:34:13 +10:00
Mathieu Pellerin
48b98def64 [geos] Add mechanism for empty interior rings to be skipped 2024-09-12 08:34:13 +10:00
Nyall Dawson
f21722a0f1 [sipify] Minor cleanup to auto additions
Condense injections into a single block instead of multiple
separate blocks
2024-09-09 16:56:29 +10:00
Jean Felder
3d070316eb qgis: Add support for TIN type 2024-09-09 06:16:25 +02:00
Jean Felder
3295d7e803 qgis: Add support for polyhedralsurface type 2024-09-09 06:16:25 +02:00
Germán Carrillo
c5286e4dcc [core] Address review: Move loadFunctionsFromProject and cleanFunctionsFromProject to QgsProject::read and ::clear, respectively. Introduce function pythonEmbeddedInProjectAllowed to ask for permissions to load both macros and expression functions, with a parameter enum and rename existing enum for macros. Sort includes. Drop not needed file. Add python/expressions/ to gitignore, to get rid of files produced by the introduced Python test. 2024-09-05 23:07:37 -05:00
Nyall Dawson
561961a11d Fix malformed enum documentation
Fixes #50176
2024-09-04 20:34:44 +10:00
Nyall Dawson
05003ba2fa [feature] Add "Linear Referencing" symbol layer type
This new symbol layer type allows placing text labels at regular
intervals along a line (or at positions corresponding to
existing vertices). Positions can be calculated using
Cartesian distances, or interpolated from z/m values.

Functionality includes:

- Labels can be placed using fixed cartesian 2d distances,
at regular linearly interpolated spacing calculated using
the Z or M values in geometries, or at existing vertices
- Labels can show either the running total distance, or
the linearly interpolated Z/M value
- Uses text rendered to draw labels, so the full range
of functionality is available for the labels (including
buffers, shadows, etc)
- Uses the QGIS numeric format classes to format numbers
as strings, so users have full range of customisation
options for eg decimal places
- An optional "skip multiples of" setting. If set, then
labels which are a multiple of this value will be skipped
over. This allows construction of complex referencing labels,
eg where a symbol has two linear referencing symbol layers,
one set to label every 100m in a small font, skipping multiples
of 1000, and a second set to label every 1000m in a big
bold font
- Labels are rendered using an angle calculated by averaging
the linestring, so sharp tiny jaggies don't result in
unslightly label rotation
- Optionally, markers can be placed at referenced points
in the line string, using a full QGIS marker symbol (this allows
eg showing a cross-hatch at the labeled point, for a "ruler"
style line)
- Data defined control over the placement intervals, skip
multiples setting, marker visibility and average angle
calculation length

Notes:

- When using the distance-based placement or labels, the
distances are calculated using 2D only, Cartesian calculations
based on the original layer CRS. This could potentially be
extended in future to expose options for 3D Cartesian distances,
or ellipsoidal distance calculations.

Sponsored by the Swiss QGIS User Group
2024-09-04 19:06:26 +10:00
Nyall Dawson
50408edac6
Fix PyQGIS docstrings for monkey patched enum values
We should be using the new name for the enum value instead
of the old one in the enum class docstring.

Move the old compatible name to an extra note
"Available as ``xx.yy`` in older QGIS releases."

Fixes #49171
2024-09-02 11:43:23 +10:00
Nyall Dawson
343709f48a Always use correct \since annotation for enum values 2024-09-01 02:29:17 +10:00
Nyall Dawson
2af54ad057 Fix malformed python docstrings when enum value has \since annotation 2024-09-01 02:29:17 +10:00
Nyall Dawson
370f74803f Only upgrade annotations on desktop 2024-08-25 12:34:51 +10:00
Nyall Dawson
c37f3d1960 Make naming more flexible 2024-08-15 14:27:35 +10:00
Nyall Dawson
76adc371ac Ensure marker halos are drawn in legends, symbol preview icons 2024-08-15 06:25:41 +10:00
Nyall Dawson
1f27fc627a [pyqgis] Wrap unambiguously static methods in staticmethod
sip doesn't use the standard Python staticmethod type for defining
static methods, which means that standard means of testing
for a static method (like `isinstance(..., staticmethod)`) fail
with any PyQGIS static methods.

This causes issues with lint tools, which incorrectly flag
calls to QGIS static methods as missing self arguments. It also
breaks detection of static methods in the sphinx PyQGIS docs,
so all static methods are shown as non-static.

Work around this in sipify, by wrapping unambiguously static
methods in staticmethod wrappers.
2024-08-14 22:08:41 +10:00
Nyall Dawson
dc68f03f88 Be tolerant against optional sip modules 2024-08-14 13:05:46 +10:00
Nyall Dawson
ed19d996b2 Collect attribute docstrings for PyQGIS documentation 2024-08-14 13:05:46 +10:00
Nyall Dawson
547387037f [annotations] Add support for callouts to point text item
Allows creating of callout lines (or bubble callouts) which
link the text to a map location. To create a callout, users
select the text item and then drag out the central x node
to the desired callout end point.

Callout styles can be modified through the layer styling panel.
2024-08-06 13:30:16 +10:00
Nyall Dawson
13c1a1b997 Force vector rendering of symbols when symbol has buffer enabled 2024-08-02 05:09:03 +10:00
Nyall Dawson
0c230a83e7 Add fixed size mode for picture annotations
When selected, the picture annotation will always be rendered
at the same size, regardless of the map scale
2024-07-26 20:38:47 +10:00
Nyall Dawson
75cca8a20c [FEATURE] Add picture annotation item type
Can render SVG or raster images as items in an annotation layer.
Options are present for:

- Locking the picture's aspect ratio
- Drawing with a background symbol
- Drawing with a border symbol
- Linked or embedded pictures
2024-07-26 20:38:47 +10:00
Nyall Dawson
4f9bdde88c
Add missing monkey patch 2024-07-18 15:04:32 +10:00
Nyall Dawson
73b25dca3e
Move QgsVectorDataProvider::Capability to Qgis::VectorProviderCapability
And promote to enum class
2024-07-18 10:42:22 +10:00
Nyall Dawson
145de5fb5e
Move QgsDataProvider::ReadFlag to Qgis::DataProviderReadFlag
and promote to enum class
2024-07-18 10:01:59 +10:00
Nyall Dawson
3b80fc0f4b
Move layout picture item format enum to Qgis, promote to enum class 2024-07-16 11:25:49 +10:00
Nyall Dawson
afd10759b0 [processing] Show notes for algs which regenerate primary keys
Add a new Qgis::ProcessingAlgorithmDocumentationFlag flag, with
a virtual method in QgsProcessingAlgorithm to return documentation
flags. These flags are used to indicate algorithm behavior which
should be noted in the documentation.

Add initial flags for algorithms which drop and regenerate
primary keys/FIDs, and automatically add a note to the algorithm's
help panel to explain that this will occur

In future this flag could be extended with other helpful warnings,
eg

- Algorithm requires valid geometries
- Algorithm will segmentize curved geometries
- Algorithm will drop Z or M values
2024-07-15 14:33:21 +10:00
Nyall Dawson
711c75d873 Promote scalebar enums to enum class, move to Qgis 2024-07-12 05:36:22 +10:00
Julien Cabieces
43062c8833 fix(CMYK): treat review comments 2024-07-11 21:13:42 +10:00
Julien Cabieces
7e527d182b feat(CMYK): add API color model and profile methods to project
API allows to define a color model without a color space. If both are
set, consistency between defined color model and color space one is
checked (only in Qt version 6.8.0 or greater because it's not possible
to retrieve color model from color space before that)
2024-07-11 21:13:42 +10:00