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.62k stars 3.01k forks source link

Geospatial PDF Export for Rasters does NOT work. #58891

Closed Mikester-Calgary closed 1 month ago

Mikester-Calgary commented 1 month ago

What is the bug or the crash?

Layer export in QGIS for rasters has an option for Geospatial PDF which always fails with the error as shown in the attached clip. Screenshot 2024-09-26 pdf

Steps to reproduce the issue

Right click on a Raster layer in QGIS. Select Export >> Save As. Select Geospatial PDF from the pulldown list. Set file output etc. >> Write fail error. >> Cannot write raster. blaa blaa

Versions

QGIS version 3.38.3-Grenoble QGIS code revision 37f9e6efee Qt version 5.15.13 Python version 3.12.6 GDAL/OGR version 3.9.2 PROJ version 9.4.0 EPSG Registry database version v11.004 (2024-02-24) GEOS version 3.12.2-CAPI-1.18.2 SQLite version 3.45.1 PDAL version 2.6.3 PostgreSQL client version 16.2 SpatiaLite version 5.1.0 QWT version 6.2.0 QScintilla2 version 2.14.1 OS version Windows 11 Version 2009

Active Python plugins CalculateGeometry 0.6.9 DigitizingTools 1.5.2 FreehandRasterGeoreferencer 0.8.3 LAStools 2.1.0 mmqgis 2021.9.10 qad 3.0.6 qgis-maptiler-plugin 3.3 qgis2web 3.21.0 qgsAzimuth 0.9.19 quick_map_services 0.19.34 rvt-qgis 0.9.6 seismic_importer 0.3 SRTM-Downloader 3.2.3 volume_calculation_tool 0.4 wbt_for_qgis 1.0.9 open_lidar_tools 2.2.2 db_manager 0.1.20 MetaSearch 0.3.6 processing 2.12.99

Supported QGIS version

New profile

Additional context

This has been a condition of at least the last 10 releases of QGIS. To my knowledge it has never worked.

rouault commented 1 month ago

@Mikester-Calgary Thank for raising this. I've submitted an "enhancement" in https://github.com/qgis/QGIS/pull/58895 which consists just in removing that choice. There are fundamental reasons why export to PDF through this interface connot be done. It would basically require to create a temporary file in one of the other formats (like TIFF) and then use another mode of the underlying GDAL library to export it to PDF. Hopefully I haven't lost you on those details. That could potentially be done automagically but that requires "a bit" of work In the meantime, you can accomplish what you want by indeed using that dialog to save as a GeoTIFF. And then in the Processing toolbox, use the GDAL "translate (convert format)" tool to convert to PDF. In the most simple situations, you may actually use directly the GDAL "translate (convert format)" tool

Mikester-Calgary commented 1 month ago

Thanks to all. Great and timely response effort as always! m