4

i have create a simple custom line style in QGIS where i have 10 dash 2 spaces and inside a cross and i have define specific distance in millimeter .

style distance

style like this :

style imege

but my style is different if i change the scale. if i have zoom in, zoom out in QGIS project then that style is differrent if i change scale in print composer then again is differrent.

here an example in scale 1:700 :

image scale 1

and here an example in scale 1:1500 :

image scale 2

in that scale union neighbors styles i think but i dont want this .

i want my style to stay Stable for any or specific scales,how to do that ?

i think the problem is the style render,can i disable style render ?

3 Answers 3

4

Try to use the size map unit instead of millimeters enter image description here

4
  • It works only if the complete line is displayed
    – JGH
    Jul 24, 2017 at 12:31
  • I do not think this is important to Mr Hellas
    – nagib
    Jul 24, 2017 at 13:11
  • :-) except that in the OP example the line is not fully displayed, and so your answer does not work in this situation. Have you tried it?
    – JGH
    Jul 24, 2017 at 13:17
  • @JGH what you mean works only if the complete line is displayed ?because i try to change to map unit and i cant see some different
    – hellas
    Jul 24, 2017 at 17:51
1

From what I understand, you are asking why the drawing at a specific location (the red marks) changes when you change the scale.

Except for the first point of your line and under very specific scales - that would be different for each of your line -, it is not possible.

As the scale changes, the distance on screen between two points of the line changes (zooming out, points appear closer to each others on the screen; zooming in, points appear farther away from each others on the screen). The style is expressed in millimeters, so the first dash is always 10 mm long, followed by 2mm of white space. If you points are displayed, on the screen, 10mm from each others, you will see a solid black line. If they are 10+2+10 mm away from each others, you will see a dash-space-dash. If they are 10+2+5 mm away from each others, you will see a dash-space-HALF dash. This distance between the points changes as you zoom in and out.

So, keeping this example, if you points are always more than 10mm away from each others, the line symbol touching the 1st point will always be a complete dash. If the distance is a multiple of 10+2, the symbol at the 2nd point will always be a space. If the distance is 10 plus a multiple of (10+2), the symbol at the 2nd point will always be the end of a dash.

Since all your points are likely at different distances from each others - both on grounds and on the screen -, the symbol drawn at the 2nd (and more) points will also be different as you zoom in/out.

You can see this in your screenshots as the number of dash changes with the scale. Moreover, if you are not drawing one but two connected lines, this computation is done independently on each line and the end result may LOOK like a single line, with a dash up to twice as long as a dash length... and there is nothing you can do about it.

1

Regardless of the unit you are using, the style is applied either from the 1st point of the line or, if it is not displayed in the current extent, from the intersection between the line and the visible extent. What is displayed at this intersection point (beginning of a dash, middle, end, space etc) is computed by the software.

For pixel or millimeters units, it seems to remain constant (i.e always the 1/4 of the dash or whatever was computed). So the distance between the points changes with the scale (see my other answer), and the symbol at other locations (the red marks in your question) changes.

For map unit, the symbol at the intersection point do change with the scale but is inconsistent between the scales, so the symbol at other locations (red marks) also change. You can see it by drawing a box and zooming exactly at the beginning of a dash. At the new scale, the intersection point will not be a dash but something else, as shown in the picture below. enter image description here

4
  • that i need to stay my style stable in print composer
    – hellas
    Jul 24, 2017 at 17:59
  • @hellas I don't think it is possible
    – JGH
    Jul 24, 2017 at 18:28
  • if you dont think if is possible then map units is not true solution,right ?
    – hellas
    Jul 24, 2017 at 19:03
  • @hellas I believe there is no solution out of the box to your issue regardless of the selected type of units
    – JGH
    Jul 24, 2017 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.