Skip to content

Expose OGR feature styles via a new "Embedded styling" renderer - #41957

Merged
nyalldawson merged 18 commits into
qgis:masterfrom
nyalldawson:feature_symbol
Mar 6, 2021
Merged

Expose OGR feature styles via a new "Embedded styling" renderer#41957
nyalldawson merged 18 commits into
qgis:masterfrom
nyalldawson:feature_symbol

Conversation

@nyalldawson

Copy link
Copy Markdown
Collaborator

This PR implements the proposal described at qgis/QGIS-Enhancement-Proposals#209, and adds a new "Embedded Symbology" renderer which shows features using their associated symbology from a datasource where features can have "baked in" symbols (such as KML or TAB files).

Currently only supports line symbol conversion, but point and polygon symbol support will come in a follow-up PR.

Peek 2021-03-02 15-22

Tested so far on MapInfo tab files and KML files, but support should extend automatically to all GDAL drivers which implement the OGR feature style API!

Also supports direct conversion of embedded symbols renderers to categorized or rule based renderers, creating categories/rules which define symbology based on the feature IDs:

Peek 2021-03-02 15-23

Sponsored by QGIS Denmark user-group

@nyalldawson nyalldawson added Feature Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Mar 2, 2021
@github-actions github-actions Bot added this to the 3.20.0 milestone Mar 2, 2021
@nirvn

nirvn commented Mar 2, 2021

Copy link
Copy Markdown
Contributor

Big tak to QGIS Denmark user-group :)

@Saijin-Naib

Copy link
Copy Markdown

This is an incredible UX win!

@DelazJ DelazJ added the Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. label Mar 3, 2021
@github-actions

github-actions Bot commented Mar 3, 2021

Copy link
Copy Markdown
Contributor

@nyalldawson
This pull request has been tagged as requiring documentation.

A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged.

Please update the description (not the comments) with helpful description and screenshot to help the work from documentors.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@nirvn nirvn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, some dox comments, but otherwise looking good.

I remember you mentioning this also supported a GDAL side file to style other dataset types. Should you add a test for that?

Comment thread src/core/qgsogrutils.cpp Outdated
Comment thread src/core/symbology/qgscategorizedsymbolrenderer.h Outdated
Comment thread src/core/symbology/qgsrendererregistry.cpp Outdated
Comment thread src/core/symbology/qgsrulebasedrenderer.h Outdated
Comment thread src/gui/qgsmaptoolidentify.cpp Outdated
@nyalldawson

Copy link
Copy Markdown
Collaborator Author

@nirvn

Thanks for the review!

I remember you mentioning this also supported a GDAL side file to style other dataset types. Should you add a test for that?

I honestly think it's an extremely niche case, and it's on GDAL's side to maintain this sidecar support, not us.

Allows for storing per-feature symbology, e.g. for symbols which
are an innate part of features from a dataset which supports
feature level symbology.
If present, the provider is able to retrieve embedded symbology
associated with individual features.
Should return true for feature renderers which require embedded
feature symbology. The corresponding feature request flag will
be set on the iterator used for the renderer will rendering vector
layers.
…y of the embedded symbol when identifying features
This renderer will draw features using their embedded feature symbology
Used as a fallback symbol for features without embedded symbology
Allows symbology embedded in TAB files to be read
Allows users to control the default symbol used for features without
embedded styles
@github-actions

github-actions Bot commented Mar 6, 2021

Copy link
Copy Markdown
Contributor

@nyalldawson
A documentation ticket has been opened at qgis/QGIS-Documentation#6571
It is your responsibility to visit this ticket and add as much detail as possible for the documentation team to correctly document this change.
Thank you!

@flippant-heron flippant-heron added ChangelogHarvested This PR description has been harvested in the Changelog already. and removed Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ChangelogHarvested This PR description has been harvested in the Changelog already. Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants