3

As you can see in the screenshot below, I use a polygon marker line with interval. If there are 2 neighboring polygons, the markers will be doubled - of course.

But I need to suppress this effect. Any ideas?

example

EDIT: In my case, the polygons are in the SAME layer.

1
  • 1
    1. Merge polygons 2. Apply a marker line with an interval to it with no fill-in property. 3. Initial polygons use without a border/edge. 4. Put Merged styled layer over initial polygons.
    – Taras
    Commented May 4, 2020 at 15:42

1 Answer 1

7

@Taras's answer is almost there, but if you dissolve the polygons first, you will only get the outer boundary and none of the inner ones.

If you are OK with creating a separate layer, you can try the following:

  1. Use Polygons to lines or Boundary geoprocessing tool on original layer
  2. Dissolve the lines from step 1
  3. Apply marker line style with no fill to the dissolved layer
  4. Disable the stroke line/border for the original layer
  5. Place the dissolved layer over the original layer.

Alternatively you can create a virtual layer with the following query:

SELECT ST_Union(ST_Boundary(geometry)) as geometry FROM polygon_layer

Alternatively, using a geometry generator symbology you can use the following expression to generate a line and style it as a marker line - the trick was to use combine() not union() to merge the geometries completely. However this can result in some strange marker placement near the intersection of multiple lines.

combine(collect(boundary($geometry)),collect(boundary($geometry)))

Before: enter image description here

After: enter image description here

Note this is also helpful when you don't want overlapping dashed lines.

7
  • p.s. dissolve ≠ merge =)
    – Taras
    Commented May 5, 2020 at 10:51
  • @Taras Do you mean "select features and merge" because that does the same thing as well, gets rid of the inner boundaries. I don't see any tool that does what you're describing with the name "merge" in the description.
    – she_weeds
    Commented May 5, 2020 at 10:59
  • I thought that author referring to two different layers, therefore IMHO applying Merge Vector Layers is fair enough.
    – Taras
    Commented May 5, 2020 at 11:04
  • Fair enough, maybe OP can clarify whether they are using two separate layers or adjacent polygons in the one layer.
    – she_weeds
    Commented May 5, 2020 at 11:56
  • 1
    OP has clarified they're polygons in the same layer. I've known this was a problem with adjacent polygons for a while as it would double up rendering dashed outlines, making it look like a single line (like in the Before pic in my answer). So thanks to OP for poking my brain as I've now solved one of my own problems as well.
    – she_weeds
    Commented May 6, 2020 at 0:49

Your Answer

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

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