542 Commits

Author SHA1 Message Date
qgis-bot
e9798f0796 auto sipify 🍺 2024-09-16 18:05:27 +00:00
Nyall Dawson
a492cb22fb [feature] Support horizontal alignment in HTML labels
For multi-line labels, this allows use of either:

- HTML <p align="xxx"> attributes
- CSS "text-align: xxx"
- HTML <center>some text</center> tags

Supported alignments are left, right, center and justify

Horizontal alignment can be used in all contexts where
HTML text is rendered, EXCEPT for curved labels (since they
are restricted to single-line text)

Sponsored by City of Freiburg im Breisgau
2024-09-16 17:26:24 +10:00
Nyall Dawson
1fc5ae33aa Add missing sip cast for QgsFilledLineSymbolLayer 2024-09-16 16:52:20 +10:00
Nyall Dawson
b7d18c009a Fix dox 2024-09-14 13:25:59 +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
Nyall Dawson
957de0c311 Expose private QgsTextRenderer method for drawing document at point
This allows more efficient rendering when the document and metrics
have already been calculated
2024-09-14 13:25:59 +10:00
Ivan Barsukov
d0dedde547 Fixed typo in allowCommitChanged 2024-09-14 06:01:01 +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
Denis Rouzaud
304f9642b4
[locator] add priority per group (#58542)
* [locator] add priority per group

* fix test

---------

Co-authored-by: signedav <david@opengis.ch>
2024-09-13 16:52:45 +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
73ab085bbc
Merge pull request #58584 from nirvn/processing_openstreetmap_policy
Further safeguards from (perceived or actual) bulk download of OpenStreetMap tiles
2024-09-12 08:12:17 +07: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
5734116a10 Support h1/h2/.../h6 formatting in html labels 2024-09-11 13:43:00 +10:00
Nyall Dawson
90524634f9 [feature] Add support for word-spacing CSS in html labels
...and other places HTML text formatting is accepted.

This allows use of CSS "word-spacing: 12" to increase the word
spacing in a section of HTML text. The word spacing is always
treated as being in point units.
2024-09-11 08:24:39 +10:00
Nyall Dawson
569da98cd8 If a rule is not available on the system (eg geos too old):
- grey out the rule in the rules list
- show an explanatory tooltip
- don't allow users to create copies of that rule
2024-09-11 02:06:41 +10:00
Nyall Dawson
6c2055fc1e Generate user-friendly tooltips 2024-09-11 02:06:41 +10:00
Nyall Dawson
2d3e6aac43 Allow labeling rules to be de-activated 2024-09-11 02:06:41 +10:00
Nyall Dawson
3ec7665fec Add gui for configuring project advanced labeling rules 2024-09-11 02:06:41 +10:00
Nyall Dawson
98bd60e4ba Add __repr__ 2024-09-11 02:06:41 +10:00
Nyall Dawson
940949cbf9 Rules can have user-configurable names 2024-09-11 02:06:41 +10:00
Nyall Dawson
538cec5970 Fix seealso 2024-09-11 02:06:41 +10:00
Nyall Dawson
15a7079a39 [api] Implementation of labeling engine rules
See https://github.com/qgis/QGIS-Enhancement-Proposals/issues/299

Implements the API framework for setting advanced labeling engine
rules for a project, and implements 4 initial rule types:

- QgsLabelingEngineRuleMinimumDistanceLabelToFeature: prevents labels
  being placed too *close* to features from a different layer
- QgsLabelingEngineRuleMaximumDistanceLabelToFeature: prevents labels
  being placed too *far* from features from a different layer
- QgsLabelingEngineRuleMinimumDistanceLabelToLabel: prevents labels
  being placed too close to labels from a different layer
- QgsLabelingEngineRuleAvoidLabelOverlapWithFeature: prevents labels
  being placed overlapping features from a different layer

(note that the first 3 rules require a build based on GEOS >= 3.10,
they are not available for older GEOS builds)

Also implements a registry for storing available rule classes,
and serialization of rules and configuration in QGIS projects
2024-09-11 02:06:41 +10:00
Nyall Dawson
391b61544e
Handle SIP_OUT with void functions 2024-09-10 11:46:47 +10:00
Nyall Dawson
b39f760cbc
Correctly handle multiline SIP_OUT param documentation 2024-09-10 11:11:25 +10:00
Loïc Bartoletti
dc65b077aa PostgreSQL: Add new geometry types
Allow PolyhedralSurface and TIN in PostgreSQL table.
Add a new GeometryColumnType and Capabilities : Surfaces.
2024-09-09 06:16:25 +02:00
Jean Felder
f43e5ad17c geometry: Add triangulatedsurface support 2024-09-09 06:16:25 +02:00
Jean Felder
3d070316eb qgis: Add support for TIN type 2024-09-09 06:16:25 +02:00
Jean Felder
59e12d50ae qgsgeometry: Use QgsPolyhedralSurface in fromBox3D 2024-09-09 06:16:25 +02:00
Jean Felder
371eca55e8 geometry: Add polyhedralsurface support 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
Jean Felder
e99d4d2306 qgssurface: Do not define surfaceToPolygon
`surfaceToPolygon` is only useful for `QgsCurvePolygon` which inherits
from `QgsSurface`. The next commit will introduce
`QgsPolyhedralSurface` which also inherits from `QgsSurface`. For
`QgsPolyhedralSurface`, it does not make sense to have
`surfaceToPolygon`.

By moving `surfaceToPolygon` definition in `QgsCurvePolygon` this
allows to keep the functionality.
2024-09-09 06:16:25 +02:00
Nyall Dawson
38af55cb85 Add missing docs 2024-09-08 16:06:22 +10:00
Nyall Dawson
cfd251e7f7 Capture signal arguments 2024-09-08 16:06:22 +10:00
Mathieu Pellerin
7fa383dc06 Address review 2024-09-06 14:57:05 +07: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
Germán Carrillo
f91fadf07a [expressions] Unload expression functions from project on project close and reload user expressions (from profile) to avoid any potential overwrite from unloaded project functions 2024-09-05 23:07:36 -05:00
Germán Carrillo
8f0ab844e4 Make sure python expression functions from project are only loaded if users allow it, just like we do with macros 2024-09-05 23:07:36 -05:00
Mathieu Pellerin
ef39464f8a
Merge pull request #58550 from nirvn/processing_openstreetmap_policy
[processing] Insure that processing algorithms are not used to breach the OSMF tile usage policy on bulk download
2024-09-05 13:50:20 +07:00
Nyall Dawson
4ec5290a46 [layouts] Add support merging cells in manual tables
Allows adjacent cells to be merged in layout manual table items.

From the table editor, select multiple cells in a rectangular
shape and then from the Table menu, click "Merge Selected Cells".
Merged cells can be un-merged via the "Split Selected Cells"
menu action.

Fixes #51694
2024-09-05 09:19:02 +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
Mathieu Pellerin
734d1d2ebf Create a QgsMapLayerUtils::isOpenStreetMapLayer function 2024-09-04 14:13:01 +07:00
Alessandro Pasotti
fac763d385
Merge pull request #58559 from elpaso/bugfix-gh52219-relation-ref-not-null-followup
Fix default AllowNotNULL for relation ref wdgt
2024-09-04 07:34:54 +02:00
Mathieu Pellerin
e3fee5d3f4 Address review 2024-09-04 11:34:51 +07:00
Nyall Dawson
cbb741fb35 Use correct subheader underline 2024-09-04 13:54:39 +10:00
Nyall Dawson
55f78cfce1 Fix QgsSvgCache parameter formatting 2024-09-04 13:54:39 +10:00
Nyall Dawson
2e60236344 Fix list in return value 2024-09-04 13:54:39 +10:00
Nyall Dawson
94f6e9c71b Correctly handle \param[in,out] in sipify 2024-09-04 13:54:39 +10:00
Nyall Dawson
e1a1b064b2 Fix multiline return with SIP_OUT 2024-09-04 13:54:39 +10:00