<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML - vooraf opgemaakt Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.HTML-voorafopgemaaktChar
{mso-style-name:"HTML - vooraf opgemaakt Char";
mso-style-priority:99;
mso-style-link:"HTML - vooraf opgemaakt";
font-family:Consolas;
mso-fareast-language:NL-BE;}
span.E-mailStijl21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.E-mailStijl22
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="NL-BE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:gray">The numbers you need to use in “rand(-10, 10), rand(-10, 10)” depend on
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:gray">the CRS of your layer. I tested it with some demo data in EPSG:31370 and I got a similar result as you. When I changed those numbers I got a better result. After
you changed those, you can play around with that 100 inside the generate_series, to get the result you want. For me the following gave a good result:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:gray"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray">make_line(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray"> array_foreach(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray"> generate_series(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray"> 0, length($geometry), 300<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray"> ),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray"> translate(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray"> line_interpolate_point($geometry, @element),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray"> rand(-0.5, 0.5),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray"> rand(-0.5, 0.5)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray"> )<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray"> )<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Courier New";color:gray">)<o:p></o:p></span></p>
<p class="MsoNormal"><i><span lang="EN-US" style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:gray"><o:p> </o:p></span></i></p>
<p class="MsoNormal"><i><span lang="EN-US" style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:gray"><o:p> </o:p></span></i></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:gray">Michel</span><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:gray"><br>
<br>
</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Van:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Qgis-user <qgis-user-bounces@lists.osgeo.org>
<b>Namens </b>David Fawcett<br>
<b>Verzonden:</b> donderdag 16 april 2020 20:01<br>
<b>Aan:</b> qgis-user </span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"><qgis-user@lists.osgeo.org><br>
<b>Onderwerp:</b> [Qgis-user] geometry generator - unexpected results<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">I am trying to use a geometry ge</span>nerator to accomplish the "hand-drawn" line style.
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Some great recent examples by:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Klas Karlsson<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://twitter.com/klaskarlsson/status/1249333750451879937">https://twitter.com/klaskarlsson/status/1249333750451879937</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Hamish:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://polemic.nz/2019/11/18/foss4g-qgis-geometry-generators/">https://polemic.nz/2019/11/18/foss4g-qgis-geometry-generators/</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I am using the code below from the blog post by Hamish in QGIS 3.12:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<pre><code>make_line(<o:p></o:p></code></pre>
<pre><code> array_foreach(<o:p></o:p></code></pre>
<pre><code> generate_series(<o:p></o:p></code></pre>
<pre><code> 0, length($geometry), 100<o:p></o:p></code></pre>
<pre><code> ),<o:p></o:p></code></pre>
<pre><code> translate(<o:p></o:p></code></pre>
<pre><code> line_interpolate_point($geometry, @element),<o:p></o:p></code></pre>
<pre><code> rand(-10, 10),<o:p></o:p></code></pre>
<pre><code> rand(-10, 10)<o:p></o:p></code></pre>
<pre><code> )<o:p></o:p></code></pre>
<pre><code> )<o:p></o:p></code></pre>
<pre style="margin-bottom:12.0pt"><code>)</code><o:p></o:p></pre>
<pre><code>Here is an image of what the results look like: <a href="https://github.com/fawcett/examples/blob/master/lines.png">https://github.com/fawcett/examples/blob/master/lines.png</a></code><o:p></o:p></pre>
<pre><code>The line geometries are in blue, and the geometry generator output is in black. </code><o:p></o:p></pre>
<pre style="margin-bottom:12.0pt"><code>Can anyone suggest what is going wrong?</code><o:p></o:p></pre>
<pre style="margin-bottom:12.0pt"><code>Thank you, </code><o:p></o:p></pre>
<pre><code>David.</code><o:p></o:p></pre>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>