qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.59k stars 3k forks source link

wrong position label on last entity on dxf export #52112

Open Huissier000 opened 1 year ago

Huissier000 commented 1 year ago

What is the bug or the crash?

I have a point layer with ten entities. a label is offset from these points I am doing a DXF export of the project

the label is well offset from the point, except on the last entity

image

image

same result with other label settings

Sorry for my bad english

Steps to reproduce the issue

  1. Layer point on a Gpkg
  2. 10 entities
  3. Label with offset with differents settings or x y position
  4. Export DXF witk project>export>dxf
  5. View DXF on DWG Trueview

Versions

Version de QGIS | 3.28.3-Firenze | Révision du code | c12bcb2f76c -- | -- | -- | -- Version de Qt | 5.15.3 Version de Python | 3.9.5 Version de GDAL/OGR | 3.6.2 Version de Proj | 9.1.1 Version de la base de données du registre EPSG | v10.076 (2022-08-31) Version de GEOS | 3.11.1-CAPI-1.17.1 Version de SQLite | 3.39.4 Version de PDAL | 2.4.3 Version du client PostgreSQL | unknown Version de SpatiaLite | 5.0.1 Version de QWT | 6.1.6 Version de QScintilla2 | 2.13.1 Version de l'OS | Windows 10 Version 2009   |   |   |   Extensions Python actives AzimuthDistanceCalculator | 2.0.2 AzimuthMeasurement | 0.2.2 cadastre | 1.16.1 coordinator | 0.4 fibees | 0.1 FilterLayersAtOnce-master | 1.0 filter_layers | 3.0 gban | 1.1 latlontools | 3.6.6 mmqgis | 2021.9.10 openlayers_plugin | 2.0.0 point_cadastre | 0.1 qfieldsync | v4.3.1 qgsAzimuth | 0.9.15 quick_map_services | 0.19.32 SgmExpressionFunctions | 3.0.4 StreetView | 3.2 SwapVectorDirection | 0.9 what3words | 4.1 processing | 2.12.99 Version de QGIS 3.28.3-Firenze Révision du code [c12bcb2f76c](https://github.com/qgis/QGIS/commit/c12bcb2f76c) Version de Qt 5.15.3 Version de Python 3.9.5 Version de GDAL/OGR 3.6.2 Version de Proj 9.1.1 Version de la base de données du registre EPSG v10.076 (2022-08-31) Version de GEOS 3.11.1-CAPI-1.17.1 Version de SQLite 3.39.4 Version de PDAL 2.4.3 Version du client PostgreSQL unknown Version de SpatiaLite 5.0.1 Version de QWT 6.1.6 Version de QScintilla2 2.13.1 Version de l'OS Windows 10 Version 2009 Extensions Python actives AzimuthDistanceCalculator 2.0.2 AzimuthMeasurement 0.2.2 cadastre 1.16.1 coordinator 0.4 fibees 0.1 FilterLayersAtOnce-master 1.0 filter_layers 3.0 gban 1.1 latlontools 3.6.6 mmqgis 2021.9.10 openlayers_plugin 2.0.0 point_cadastre 0.1 qfieldsync v4.3.1 qgsAzimuth 0.9.15 quick_map_services 0.19.32 SgmExpressionFunctions 3.0.4 StreetView 3.2 SwapVectorDirection 0.9 what3words 4.1 processing 2.12.99 ### Supported QGIS version - [X] I'm running a supported QGIS version according to the roadmap. ### New profile - [X] I tried with a new QGIS profile ### Additional context _No response_
agiudiceandrea commented 1 year ago

@Huissier000 please provide a sample project + layer in order to replicate the issue.

Huissier000 commented 1 year ago

issue.zip

Thanks. Here an example with 2 shapes/

shape1 : one label shape2 : 2 labels

example.dxf shape 1 ok, shape2 with 2 entities without 1 or 2 labels example2.dxf : shape 2 ok, shape 1 with one entity without label

image

image

Huissier000 commented 1 year ago

I also tested with these settings with the same result

image

agiudiceandrea commented 1 year ago

@Huissier000 thanks for reporting and providing all the needed info.

I can confirm the issue on Windows using QGIS 3.30.0 and 3.28.4 and previous versions (tested 3.22, 3.16, 3.10).

The issue occur when a label offset is set. It seems the issue occurs for labels whose anchor point (considering the offset) is outside the extent of all the layers.

In fact, if you add a third layer with features placed at east of the eastern feature of the two layer and south of the southern features of the two layer, or if you encircle the area of the features of the two layers with a polygon or a line, all the labels of the two layer will be correctly present in the exported DXF file.