Bug report #18917
QGIS 3 "Meters at Scale" incorrect behavior
|Affected QGIS version:||3.0.2||Regression?:||No|
|Operating System:||Windows 10||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||26749|
I tried using "Meters at Scale" to set the sizes of symbols in layer styles. I don't find "Meters at Scale" documented, but what I think it "should" do is set a size in actual meters (on the earth), independent of latitude and independent of CRS. I am finding that "Meters at Scale" does not equal actual meters and its behavior changes depending on the Project CRS, with scaling depending on latitude.
Steps to duplicate:
1. Create a new QGIS project.
2. Set the project CRS to WGS 84, EPSG:4326.
3. Make a new temporary scratch layer with MultiLineString / MultiCurve geometry, with CRS of EPSG:4326 - WGS 84.
4. Add a horizontal line feature near 48 degrees north latitude. Style the line as "Simple line" with a "Stroke width" of 100 "Meters at Scale".
5. Zoom in on the line and measure its width with the Measure tool. It measures around 149.5 meters. Shouldn't it be 100 meters wide? The 149.5 meters width seems to be 100/cos(48°).
6. Now, just for fun, change the project CRS to WGS 84 / Pseudo Mercator, EPSG:3857. When you hit "Apply", the line snaps to a smaller width, which measures as 66.8 meters. It went from too large to too small. The 66.8 meters width seems to be 100*cos(48°) -- now multiplied by the cosine rather than divided. I can't imagine that this kind of CRS dependence is correct behavior.
If I follow the above steps, but draw the line at the equator instead at 48 degrees north latitude, its width measures 100 meters, independent of project CRS.
I also tried it with point geometry, styled with a Simple marker -- a square symbol, sized at 100 "Meters at Scale". Same result.