Bug report #20489

QGIS composer export - issue with projection, scale & scalebar ?

Added by Michael Douchin over 5 years ago. Updated about 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:2.18.25 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:28309

Description

I am facing what seems to be an issue, or probably something well known by anyone but me...

I have created 2 very simple QGIS projects (attached with data)

  • 1 vector polygon grid 1km X 1km (GeoJSON), created with the Vector processing tool.
  • 1 OpenStreetMap TMS background layer (EPSG:3857)
  • 1 A4 composer with a map taking full size, and a scale bar
  • 1 project in EPSG:3857 & its brother in EPSG:2154 (French proj)

Issues noted:

  • In the composer, the scale bar does not fit with the 1km grid, in both projects.
  • After defining the same scale (1:10 000) in the composers, the view are really different in the 2 projects (see attached PDF)

I know projections are biased representations of the reality, but as a user perspective, this 2 behaviours really seem like issues. Every time a user prints a map and take the A4 paper, he is condident he will be able to use his ruler to measure things and convert to real distances according to the scale. Or report N times the scale bar segments to get distances.

I am like someone who just discovers the Earth is not flat...

NB: I have tested this behaviour only in 2.18.

bug_qgis_server_getprint_scale_EPSG_2154.qgs (29.7 KB) Michael Douchin, 2018-11-14 12:01 PM

bug_qgis_server_getprint_scale_EPSG_3857.qgs (29.7 KB) Michael Douchin, 2018-11-14 12:01 PM

export_pdf_qgis_3857_10000.pdf (2.53 MB) Michael Douchin, 2018-11-14 12:01 PM

export_pdf_qgis_2154_10000.pdf (2.86 MB) Michael Douchin, 2018-11-14 12:01 PM

grid_1000m.geojson (172 KB) Michael Douchin, 2018-11-14 12:01 PM

export_qgis_explanations.pdf (182 KB) Michael Douchin, 2018-11-15 10:43 AM

History

#1 Updated by Nyall Dawson over 5 years ago

  • Status changed from Open to Feedback

What solution would you propose here?

#2 Updated by Michael Douchin over 5 years ago

I have no solution at present, because I first need to understand what is considered correct or not in the GIS community, and perhaps I missed something here...

In my humble opinion:

  • a Scale bar in the composer should always be trusted on a paper printed export. Even if the printer has rescaled the layout (for example by adding margins), the scale bar should fit completely with the data underneath, for any projection: in the attached projects, 1 km in the scalebar must fit exactly with 1 side of a 1km square. Just like the distance measure tool in QGIS canvas does (when I measure a distance in the QGIS project between 2 grids, in the 3857 and 2154 projects, QGIS shows me 1000 m, which is correct and expected).
  • if the printer machine does not rescale the page (by adding margins), the user should trust the scale of the printed map (physical map on paper, I mean ;-) ), if the projection has been correctly chosen. If I have printed a 1:10 000 map, 1cm on the A4 paper map should always represent 10 000 cm = 100 metres. I know I cannot trust a scale in a screen, because of the screen resolution, but I think GIS users believe they can trust a scale in a printed map (at big scales such as 1:10000). It can be different for the mercator EPSG:3857 version, because this projection is worlwide and known for not respecting distances but angles. But the French IGN projection is more local, and the result PDF seems wrong, probably because of the scale bar.

I am completely aware that the Earth is not flat and that the act of projecting data has consequences. It is very clear to me that measuring the width of Antartica in a Mercator map with a ruler and multiplying it by the scale will lead to very wrong distance.

In the 2 attached PDF we have a "real world" square grid layer visible in the layout, and this rendering compared to the scale bar rendering with the background OSM layer make me feel as a chicken in front of a knife (French expression...)

#3 Updated by Michael Douchin over 5 years ago

Ok, I finally understand the "issue". There is no QGIS issue, but a lack of explanation I think.

  • scale bar segments in "maps units" are calculated in the QGIS canvas SCR, in cartesian Wich is ok to match data in the same projection, but can feel awkward.
  • scale bar segments in meter are calculated by using the spheroid, wich leads to correct and reliable representation (IMHO)
I attached a new PDF with 2 vector layers:
  • 1 grid generated in EPSG:3857 in grey
  • 1 grid generated in EPSG:2154 in red
  • Map canvas in EPSG:3857

I cannot tell if the 1:10000 scale, as set in the map composer option, and visible in the numeric scale, is calculated in map units or not ?

#4 Updated by Jürgen Fischer over 5 years ago

Please test with QGIS 3.4 - QGIS 2.18 reached it's end of life.

#5 Updated by Giovanni Manghi about 5 years ago

  • Resolution set to end of life
  • Status changed from Feedback to Closed

End of life notice: QGIS 2.18 LTR

Source:
http://blog.qgis.org/2019/03/09/end-of-life-notice-qgis-2-18-ltr/

QGIS 3.4 has recently become our new Long Term Release (LTR) version. This is a major step in our history – a long term release version based on the massive updates, library upgrades and improvements that we carried out in the course of the 2.x to 3x upgrade cycle.

We strongly encourage all users who are currently using QGIS 2.18 LTR as their preferred QGIS release to migrate to QGIS 3.4. This new LTR version will receive regular bugfixes for at least one year. It also includes hundreds of new functions, usability improvements, bugfixes, and other goodies. See the relevant changelogs for a good sampling of all the new features that have gone into version 3.4

Most plugins have been either migrated or incorporated into the core QGIS code base.

We strongly discourage the continued use of QGIS 2.18 LTR as it is now officially unsupported, which means we’ll not provide any bug fix releases for it.

You should also note that we intend to close all bug tickets referring to the now obsolete LTR version. Original reporters will receive a notification of the ticket closure and are encouraged to check whether the issue persists in the new LTR, in which case they should reopen the ticket.

If you would like to better understand the QGIS release roadmap, check out our roadmap page! It outlines the schedule for upcoming releases and will help you plan your deployment of QGIS into an operational environment.

The development of QGIS 3.4 LTR has been made possible by the work of hundreds of volunteers, by the investments of companies, professionals, and administrations, and by continuous donations and financial support from many of you. We sincerely thank you all and encourage you to collaborate and support the project even more, for the long term improvement and sustainability of the QGIS project.

Also available in: Atom PDF