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.5k stars 2.99k forks source link

WMS labels are cut off during export of layout #55556

Open cemno opened 10 months ago

cemno commented 10 months ago

What is the bug or the crash?

When exporting a layout to any format (pdf, png), the WMS layer labels are clipped at a vertical and horizontal line.

Steps to reproduce the issue

  1. Create a new project
  2. Add WMS service with labels (WMS, layer "Flurstücke") & a basemap
  3. Create a map in a layout with a scale large enough to display labels
  4. Check that the labels are displayed correctly in the preview
  5. Export to PNG or PDF
  6. See how the labels are now cut off along a horizontal and vertical line (I manually added the red lines in paint for visual guidance). Example with red lines added to show clipping

Versions

QGIS-Version 3.34.0-Prizren QGIS-Codeversion ffbdd67881
Qt-Version 5.15.3
Python-Version 3.9.5
GDAL-Version 3.7.2
PROJ-Version 9.3.0
EPSG-Registraturdatenbankversion v10.094 (2023-08-08)
GEOS-Version 3.12.0-CAPI-1.18.0
SQLite-Version 3.41.1
PDAL-Version 2.5.5
PostgreSQL-Client-Version 15.2
SpatiaLite-Version 5.1.0
QWT-Version 6.1.6
QScintilla2-Version 2.13.4
BS-Version Windows 10 Version 2009
       

Aktive Python-Erweiterungen db_manager | 0.1.20 grassprovider | 2.12.99 MetaSearch | 0.3.6 processing | 2.12.99

QGIS-Version 3.34.0-Prizren QGIS-Codeversion ffbdd67881 Qt-Version 5.15.3 Python-Version 3.9.5 GDAL-Version 3.7.2 PROJ-Version 9.3.0 EPSG-Registraturdatenbankversion v10.094 (2023-08-08) GEOS-Version 3.12.0-CAPI-1.18.0 SQLite-Version 3.41.1 PDAL-Version 2.5.5 PostgreSQL-Client-Version 15.2 SpatiaLite-Version 5.1.0 QWT-Version 6.1.6 QScintilla2-Version 2.13.4 BS-Version Windows 10 Version 2009

Aktive Python-Erweiterungen db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99

Supported QGIS version

New profile

Additional context

I have already tried different scales, but the lines where the clipping occurs are in exactly the same positions. I have prepared an example file here: example_cut_off_export.zip

cemno commented 10 months ago

It appears that the tile for the WMS request ends there and a new request is made. Lowering the DPI of the export enlarges the single tile to the point where it completely fills the map in the layout. The strange thing is that the WMS is limited to a maximum of 5000 pixels in both dimensions, which should not be reached by an A4 300 DPI map (288mm / 25,4mm/i ~= 11,34i -> 11,34i * 300p/i = 3402p).

I don't think this should happen, or at least it should be possible to adjust the DPI for the mapelement (or even better, specific layers).

kannes commented 2 months ago

I am afraid there is not much one can do here.

-> The WMS might decide to label feature X a certain way for the one image, but not to label it (because too small or outside extents) for the neighboring image -> The label is cut.

You could try to change the request step size to 5000 pixels for this WMS to improve the situation.

cemno commented 2 months ago

I'm not sure how important this feature is, but as a lot of data is provided by WMS (and probably more so in the future), this seems to be a strong limitation when creating large high-resolution maps with QGIS. Would it be possible to overlap the request on the client side or is this something the server has to implement?

For my case increasing the step size was enough, but creating a DIN A2 or A1 map with acceptable print quality is still impossible.

Edit: For everybody who didn't know where to find the setting, the step size can be changed in the Layer -> Data Source Manager when selecting that layer.