Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cartographic label placement with "Distance Offset: From Symbol Bounds" shows offset for MultiPoint features #53030

Closed
2 tasks done
mblesius opened this issue May 6, 2023 · 1 comment · Fixed by #53408
Closed
2 tasks done
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Labeling Related to QGIS map labeling

Comments

@mblesius
Copy link

mblesius commented May 6, 2023

What is the bug or the crash?

The cartographic labeling placement mode adds a large offset to labels of MultiPoint geometries when the Distance offset from option is set to From Symbol Bounds. For single-part geometries, the offset does not occur.

In the screenshot below, compare the expected behavior that occurs with the labeling of Point 2 with the undesired behavior that occurs for the features Point 1 and Point 3.

grafik

Steps to reproduce the issue

  1. Add a MultiPoint vector layer with multi-part geometries to a new QGIS project
  2. Turn on labeling
  3. By default, cartographic labeling should already be selected
  4. Make sure that the Distance offset from option is set to From Symbol Bounds

Test data set from the screenshot:
multipoint.zip

Versions

QGIS version 3.30.2-'s-Hertogenbosch QGIS code revision 0992b53
Qt version 5.15.3
Python version 3.9.5
GDAL/OGR version 3.6.4
PROJ version 9.2.0
EPSG Registry database version v10.082 (2023-02-06)
GEOS version 3.11.2-CAPI-1.17.2
SQLite version 3.41.1
PDAL version 2.5.2
PostgreSQL client version unknown
SpatiaLite version 5.0.1
QWT version 6.1.6
QScintilla2 version 2.13.1
OS version Windows 10 Version 2009
       
Active Python plugins
db_manager 0.1.20
grassprovider 2.12.99
MetaSearch 0.3.6
processing 2.12.99

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

No response

@mblesius mblesius added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label May 6, 2023
@YoannQDQ YoannQDQ added the Labeling Related to QGIS map labeling label May 7, 2023
@elpaso
Copy link
Contributor

elpaso commented Jun 7, 2023

I briefly looked at the code, the obstacle geometry is calculated on the bbox of the geometry collection on purpose, see QgsVectorLayerLabelProvider::getPointObstacleGeometry which sets the symbol size, which is then used for the offset in FeaturePart::createCandidatesAtOrderedPositionsOverPoint the single point symbol size is not available at that point so I'm not really sure what should be done here.

@nyalldawson this looks like a bug to me, what do you think?

elpaso added a commit to elpaso/QGIS that referenced this issue Jun 8, 2023
qgis-bot pushed a commit that referenced this issue Jun 21, 2023
nyalldawson pushed a commit that referenced this issue Jun 22, 2023
nyalldawson pushed a commit that referenced this issue Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Labeling Related to QGIS map labeling
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants