Open nyalldawson opened 1 year ago
Thank you for submitting your proposal to the 2024 QGIS Grant Programme. The 2 week discussion period starts today. At the end of the discussion, the proposal author has to provide a 3-line pitch of their proposal for the voter information material. (For an example from last year check https://github.com/qgis/PSC/issues/58#issuecomment-1567892412)
The final report for this proposal has already been submitted. Can the issue be closed?
QGIS Enhancement: Update older annotation items to new framework
Date 2023/05/02
Author Nyall Dawson (@nyalldawson)
Contact nyall dot dawson at gmail dot com
maintainer @nyalldawson
Version QGIS 3.34
Summary
For decades, QGIS supported a few "annotation" item types for drawing over map canvases: text, HTML, SVG and "form" annotations. In version 3.16 a new framework for handling annotations and annotation layers was added to QGIS which was designed around modern requirements and provided a more flexible approach for annotations. This newer framework supports point, line, polygon, text-at-point and text-along-line annotations.
In order to keep existing workflows unaffected, the older annotation items (text, html, svg and form) were left untouched during the introduction of the newer framework. The unfortunate side effect of this is that users have two completely different annotation types used in QGIS, and each has a completely different means of creation, interaction and handling.
This proposal concerns moving some of the older annotation types (specifically "text" and "svg") over to the newer framework, in order to provide a more consistent and user friendly interface to QGIS users. Porting the remaining older annotation types ("html" and "form") is left as a potential follow up project. The Text and SVG items are targeted here as they are more widely used and consequently command a higher priority.
Missing Functionality
Some feature gaps exist between the existing Text and SVG annotation items and what is possible in the newer annotation layer framework. Specifically:
This functionality will need to be made available to the newer annotation layer framework in order to avoid loss of features.
Proposed Solution/Deliverables
First, the missing functionality described in the above section will be added to the newer QgsAnnotationItem and QgsAnnotationLayer class.
Specifically:
Then, a new QgsAnnotationPictureItem class will be created which allows for a (linked or embedded) picture to be shown on the map. This item will support SVG and raster image formats, and is intended as a direct replacement for the existing older SVG annotation type.
Finally, code will be added to QgsProject to ensure that the older text and SVG annotations are automatically translated to their newer annotation item equivalents so that older projects will appear correctly when loaded into newer QGIS releases.
Example(s)
(optional)
Affected Files
Performance Implications
None
Further Considerations/Improvements
(optional)
Backwards Compatibility
Projects created using the replacement item types will NOT be compatible with earlier QGIS releases. These annotations will disappear from the projects if opened in these older releases.
Issue Tracking ID(s)
Votes
(required)