Bug report #21092

Marker line with custom dash

Added by Sergey Chernyshov 12 months ago. Updated 12 months ago.

Status:Open
Priority:Normal
Assignee:-
Category:Symbology
Affected QGIS version:3.4.4 Regression?:No
Operating System:Win 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:28910

Description

Rendering of comlex line symbol ( marker line with custom dash line ) show different incorrect results on different scales. See examples on the pictures. "Scale 1:500" shows correct rendering. Position of marker match the gap of dashed line. "Scale 1:250" - line cross the symbol. "Scale 1:10000" - wrong symbol size. Size of symbol is set in map units. With this scale it must be one pixel only or invisible. I see this problem in both QGIS 2.18 and 3.4 versions.

500.png - Scale 1:500 (15 KB) Sergey Chernyshov, 2019-01-25 07:34 AM

250.png - Scale 1:250 (22.5 KB) Sergey Chernyshov, 2019-01-25 07:34 AM

Font.png - Symbol parameters - font size in map units (33.4 KB) Sergey Chernyshov, 2019-01-25 07:34 AM

10000.png - Scale 1:10000 (172 KB) Sergey Chernyshov, 2019-01-25 07:34 AM

Line.png - Symbol parameters - dashed line (26.2 KB) Sergey Chernyshov, 2019-01-25 07:34 AM

Symbol.png - Symbol parameters - symbol placement (17.2 KB) Sergey Chernyshov, 2019-01-25 07:34 AM

History

#1 Updated by Sergey Chernyshov 12 months ago

BTW check/uncheck flag "clip features to canvas extent" in Advanced doesn't solve it

#2 Updated by Giovanni Manghi 12 months ago

  • Easy fix? changed from Yes to No
  • Status changed from Open to In Progress
  • Regression? changed from Yes to No

Please try the latest version available, 3.4.4

#3 Updated by Sergey Chernyshov 12 months ago

Giovanni Manghi wrote:

Please try the latest version available, 3.4.4

In ver 3.4.4 result is the same.

#4 Updated by Sergey Chernyshov 12 months ago

I see the problem is because rendering uses different algorythmes for draw Marker line and Simple line with Custom dash pattern.
For Marker line I set Marker placement parameter = "with interval" and Units for this interval are "Map units". Rendering algorythm calculates position of each markers from the beginning of line.
I expected the the same algorythm for dashed line. But it differs!
Pen object uses Custom Dash Pattern (qgslinesymbollayerv2.cpp):
mPen.setStyle( Qt::CustomDashLine );
...
mPen.setDashPattern( scaledVector );

Then beninning of dashes / spaces depends on current visible frame, visible part of feature, etc.

#5 Updated by Giovanni Manghi 12 months ago

  • Status changed from In Progress to Open
  • Affected QGIS version changed from 3.4.2 to 3.4.4

#6 Updated by Alexis Roy-L 12 months ago

Did some tests, on my end, only font marker seem to behave this way. Typical symbols and SVGs are ok and maintain their scale when zoomed out.

#7 Updated by Sergey Chernyshov 12 months ago

Alexis Roy-L wrote:

Did some tests, on my end, only font marker seem to behave this way. Typical symbols and SVGs are ok and maintain their scale when zoomed out.

The problem is with custom dashes and spaces (in map units!). In my tests all types of symbol were rendered correct.

Also available in: Atom PDF