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

Scale bar decorator location not well documented or selectable #30726

Open mankoff opened 5 years ago

mankoff commented 5 years ago

Describe the bug

Scale bar is not clearly tied to a specific location on the display, and/or it is displaying values incorrectly in CRS EPSG:4326

How to Reproduce

  1. Turn on scale bar
  2. Set CRS to EPSG:4326 or other?
  3. Pan around. Scale bar does not change

image

image

QGIS and OS versions

QGIS version 3.8.0-Zanzibar QGIS code revision 11aff65
Compiled against Qt 5.9.5 Running against Qt 5.9.5
Compiled against GDAL/OGR 2.2.3 Running against GDAL/OGR 2.2.3
Compiled against GEOS 3.6.2-CAPI-1.10.2 Running against GEOS 3.6.2-CAPI-1.10.2 4d2925d6
PostgreSQL Client Version 10.9 (Ubuntu 10.9-0ubuntu0.18.04.1) SpatiaLite Version 4.3.0a
QWT Version 6.1.3 QScintilla2 Version 2.10.2
PROJ.4 Version 493
OS Version Ubuntu 18.04.2 LTS    
alexbruy commented 4 years ago

But should scalebar values change on pan? When you pan map scale is not changed, right?

mankoff commented 4 years ago

The system is poorly defined. What part of the image is the scale bar tied to? Why wouldn't panning change the scale in the image at the top of this page? If the scale bar is tied some pixel coords, then it should change. If it is tied to some geographic coordinates, which ones? Where? And why isn't it placed there or have an arrow to that location?

alexbruy commented 4 years ago

Sorry, I fail to see how map scale can be changed when panning across canvas.

I'm afraid, you are misnderstanding what it does. Scalebar shows map scale, not map orientation/direction.

mankoff commented 4 years ago

Scale bar shows a relation: pixels to km.

On the graphic at the top, 100 pixels over Greenland is X km. 100 pixels over Africa is NOT X km.

The scale bar shows 4000 km. Greenland is not 4000 km wide. Where on the map is the scale bar referenced to?

nyalldawson commented 4 years ago

If you're referring to scale bars in layouts, they are calculated using the distances determined along a horizontal line along the minimum y value of the map.

mankoff commented 4 years ago

@nyalldawson I'm still not seeing this. Can you be more explicit and define "map"? Is that the viewable area or something larger than that? By my interpretation of what you wrote, then for EPSG:3857 or 4326 or similar the scale bar should change when I pan vertically, because the bottom of the viewable map (minimum y pixel value on screen) is changing. In QGIS figure below there is no part of the viewable area that matches that scalebar. The bar itself at bottom left should be 2500 km not 6000 km (see GE image), and anywhere farther north, it should be < or << 2500 km.

So where is the 6000 km coming from? And shouldn't that be the default placement location of the scale bar (if it is tied to minimum y value, why is it placed by default at top left, unless y=0 is the top of the screen?)

qgis ge

gioman commented 4 years ago

So where is the 6000 km coming from? And shouldn't that be the default placement location of the scale bar (if it is tied to minimum y value, why is it placed by default at top left, unless y=0 is the top of the screen?)

@mankoff your project in in EPSG 3857 which isn't a proper CRS for any kind of measurements. Have you tried set the project CRS to a projected one that is a proper one for the geographic area you are working on?

gioman commented 4 years ago

Screenshot_20200120_115130

mankoff commented 4 years ago

@gioman what do you mean by "isn't a proper CRS for any kind of measurements"? And do you mean the same thing for EPSG:4326? I disagree. I note that Google Maps does have a scale bar and does change appropriately as the map is panned. I don't think that Google Maps is the standard that QGIS should strive for, but 4326 can have a scalebar, as can 3857, but it just takes a bit more work - the location to which the scale bar should be clarified. As per the issue title, it should either be documented or selectable.

If 3587 "isn't a proper CRS for any kind of measurement" then why is QGIS giving me the option to add a Scale Bar Decorator?

jmonticolo commented 4 years ago

I've try to add a Scale Bar Decorator in EPSG: 2154 for France and it works perfectly. If I change the SCR to 4326 or 3857, the Scale Bar displays wrong distances. I think it's a trap actually for those who don't check the values, because QGIS displays the Decorator without warning. Scale bar perfectly works under layout Manager, even for SCR like 4326 or 3857.

ReinierNL commented 3 years ago

If you're referring to scale bars in layouts, they are calculated using the distances determined along a horizontal line along the minimum y value of the map.

Since the scale bar apparently corresponds to the scale at the equator, probably the minimum absolute y value is meant, and 'the map' is the whole world (or perhaps the validity domain of the CRS).