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

[Layout] Geospatial PDF has incorrect georeference info for the overlapping region of the Map items #60248

Open
2 tasks done
agiudiceandrea opened this issue Jan 23, 2025 · 0 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks

Comments

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jan 23, 2025

What is the bug or the crash?

A Geospatial PDF (ISO 32000 Extension), exported from a print layout containing 2 (or more) totally or partially overlapping Map items, has incorrect georeferencing information for the overlapping region of the Map items.

The zip archive testlayout.zip contains a vector layer (CRS EPSG:32633 "WGS 84 / UTM zone 33N") with 2 line features (each one having a Cartesian length of 1 km) and a simple project testlayout.qgz with a print layout in which there are 2 partially overlapping Map items (both CRS EPSG:32633) representing the same layer.

The Geospatial PDF Layout 1.pdf has been exported setting the Geospatial PDF (ISO 32000 Extension) option.

Opening the exported Geospatial PDF with Adobe Acrobat Reader 2024.005.20320 on Windows 10 is it possible to verify that, while the lines length in non overlapping regions is correctly measured (1 km), the line length in the overlapping region is incorrect (0,67 km)

Video_2025-01-23_223900.mp4

Note: this is a simpler version, with a simpler reproducible example, of the issue report #60204.

Steps to reproduce the issue

  1. open the provided QGIS project
  2. create a Geospatial PDF (ISO 32000 Extension) with default settings
  3. open the Geospatial PDF with Adobe Acrobat Reader
  4. measure the line features using the measuring tool

Versions

QGIS version3.40.2-Bratislava
QGIS code revision14826ca1
 
Libraries
Qt version5.15.13
Python version3.12.8
GDAL/OGR version3.9.3
PROJ version9.5.0
EPSG Registry database versionv11.016 (2024-08-31)
GEOS version3.13.0-CAPI-1.19.0
SQLite version3.46.1
PDAL version2.8.1
PostgreSQL client version16.2
SpatiaLite version5.1.0
QWT version6.3.0
QScintilla2 version2.14.1
OS versionWindows 10 Version 1903
 
Active Python plugins
db_manager0.1.20
grassprovider2.12.99
MetaSearch0.3.6
processing2.12.99

Supported QGIS version

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

New profile

Additional context

It looks like the georeferencing info in the overlapping region is taken form the bottommost Map item instead of the topmost Map item.

I guess this may be due to the fact that

  • the items in the QgsPrintLayout object are listed from the topmost to the bottommost
  • so the georeferencing information of the Map items are written from the topmost to the bottommost Map item in the composition.xml file which is used by GDAL to actually generate the PDF
  • when the PDF is generated by GDAL, the last georeferencing information (the bottommost one) takes precedence in the generated PDF
@agiudiceandrea agiudiceandrea added Bug Either a bug report, or a bug fix. Let's hope for the latter! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks labels Jan 23, 2025
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! Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks
Projects
None yet
Development

No branches or pull requests

1 participant