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

projecting label coordinates for multiPoint geometry crashes QGIS #45148

Closed
2 tasks done
tschuettenberg opened this issue Sep 20, 2021 · 0 comments · Fixed by #45150
Closed
2 tasks done

projecting label coordinates for multiPoint geometry crashes QGIS #45148

tschuettenberg opened this issue Sep 20, 2021 · 0 comments · Fixed by #45150
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption

Comments

@tschuettenberg
Copy link

What is the bug or the crash?

When using the expression functions "x" / "y" in combination with the function "project(point,distance,azimuth[,elevation])" on a multiPoint geometry in order to offset the label's position, QGIS crashes.

Steps to reproduce the issue

  1. find a geopackage "label_issue.gpkg" (500 KB) with data, qml and project file here: https://ablage.qgis.de/index.php/s/ayAYG4js6xmi3BT
  2. open the project, there are two layers of identical points: "ap_test_point" with geometry type (single) point and styling and "ap_test_multipoint" of geometry type multiPoint, although there are no multipart objects, every feature consists of only one single geometry/part.
  3. on the layer ap_test_multipoint set a label with data defined override for the placement of the label coordinates using x and y of the projected geometry:
    x ( project ( $geometry, 5, 3.14 )) remember: $geometry is multiPoint here, this works fine with single point geometries.
  4. typing or pasting this expression crahes QGIS immediately.
    (The expression on "ap_test_point" looks like this x(project($geometry,min(@map_scale*0.04,5), -"S0P0P_SY_ROTATION")) and would also crash QGIS on the multipoint layer.)

Versions

QGIS version
3.16.11-Hannover
QGIS code revision
26cc1c7
Compiled against Qt
5.11.2
Running against Qt
5.11.2
Compiled against GDAL/OGR
3.1.4
Running against GDAL/OGR
3.1.4
Compiled against GEOS
3.8.1-CAPI-1.13.3
Running against GEOS
3.8.1-CAPI-1.13.3
Compiled against SQLite
3.29.0
Running against SQLite
3.29.0
PostgreSQL Client Version
11.5
SpatiaLite Version
4.3.0
QWT Version
6.1.3
QScintilla2 Version
2.10.8
Compiled against PROJ
6.3.2
Running against PROJ
Rel. 6.3.2, May 1st, 2020
OS Version
Windows 7 SP 1 (6.1)
Active python plugins
alkisplugin;
BaSYSPlanApp;
changeDataSource;
DataDrivenInputMask;
DataPlotly;
DbgBaum;
dimensioning;
Discovery;
EasyTemplatePrint;
instantprint;
maplibrary;
menu_from_project;
pg_metadata;
PostNAS_Search;
qgiscloud;
xplanung;
db_manager

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

The given points here represent the connection of sewer pipes, so it does not make sense to be multi. The pipe connections are normaly reperested by the single point where their center lines meet. My solution/workaround therefore is to avoid a useless conversion to multipoint. Having these converted to multipoint was by accident anyway, but reveald the described issue.

I'm mot 100% sure, if the used expression must work on multipoints but none the less is the crash not the best way to let the user know...

Cheers!

@tschuettenberg tschuettenberg added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Sep 20, 2021
@elpaso elpaso self-assigned this Sep 20, 2021
elpaso added a commit to elpaso/QGIS that referenced this issue Sep 20, 2021
qgis-bot pushed a commit that referenced this issue Sep 20, 2021
espinafre pushed a commit to espinafre/QGIS that referenced this issue Sep 29, 2021
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! Crash/Data Corruption
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants