<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thanks Charles,</p>
    <p>This will be very useful. Nice to know I'am not the only one
      going crazy with this!!!</p>
    <p>Nicolas<br>
    </p>
    <div class="moz-cite-prefix">On 2021-08-30 4:42 p.m., Charles
      Dixon-Paver wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAK2KqicSoitnwQH0xnxKkkJ2D=fD34DkR8yE7LPrjggfpUE4Bw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">I thought this would be easily solved with an
        expression but sadly I haven't been able to get reliable results
        at all.<br>
        <br>
        My first thought was <span style="font-family:monospace">collect($geometry,filter:=intersects($geometry,geometry(@parent)))</span>
        and when that didn't work I tried various aggregates and union
        operations to no avail. Something like this might be useful if
        you can get it into a usable form (I managed to get various
        multigeometries in the form you are looking for but wasn't able
        to do much with them and there seemed to be artifacts):<br>
        <br>
        <span style="font-family:monospace">collect_geometries(array_foreach(aggregate(layer:='lines',aggregate:='array_agg',expression:=$geometry,filter:=intersects($geometry,geometry(@parent))),@element))</span><br>
        <br>
        I was actually waiting for someone else to come up with a more
        elegant solution, but it would probably also be possible to
        identify intersecting features and get the minimum/ maximum
        feature id for intersecting features with this:<br>
        <br>
        <span style="font-family:monospace">aggregate(layer:='lines',<br>
          aggregate:='min',<br>
          expression:="fid",<br>
          filter:=intersects($geometry,geometry(@parent)))</span><br>
        <br>
        You could use that in the field calculator to create a field for
        "grouping" various intersecting features to dissolve on, however
        it's only going to identify the minimum of the currently
        intersecting features so you would need to iterate through the
        process multiple times. I can't think of an effective way to
        implement a "while" conditional either.<br>
        <br>
        It's a pretty clanky way to do it, but if you are really
        struggling I think it's possible.<br>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Mon, 30 Aug 2021 at 22:10,
          Nicolas Cadieux <<a
            href="mailto:njacadieux.gitlab@gmail.com"
            moz-do-not-send="true">njacadieux.gitlab@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="auto">Hi,
            <div><br>
              <div>Seems like the plugin is available so I will try it
                out.  The ability to create multi-linestring out of any
                touching lines (touch here means intersects at the first
                or last node) would be nice to have it if I can include
                it in a model. </div>
              <div><br>
              </div>
              <div>My goal is for this model to work for anyone with a
                basic install of QGIS LTR or 3.20 with minimal efforts
                so I am trying to eliminate the need to rely on external
                plugins or scripts.</div>
              <div><br>
              </div>
              <div>This is also my first attempt with models. It’s a
                learning curve but I am having fun… I think this
                probably should have been a plugin but my knowledge of
                GUI programming is basically 0.  That will be for a next
                project…</div>
              <div><br>
                <div dir="ltr">Nicolas Cadieux
                  <div><a href="https://gitlab.com/njacadieux"
                      target="_blank" moz-do-not-send="true">https://gitlab.com/njacadieux</a></div>
                </div>
                <div dir="ltr"><br>
                  <blockquote type="cite">Le 30 août 2021 à 14:59, David
                    Strip <<a href="mailto:qgis-user@stripfamily.net"
                      target="_blank" moz-do-not-send="true">qgis-user@stripfamily.net</a>>
                    a écrit :<br>
                    <br>
                  </blockquote>
                </div>
                <blockquote type="cite">
                  <div dir="ltr"> I looked at the source for this
                    plug-in and as far as I can tell  it only merges
                    lines that meet at endpoints. It ignores
                    multi-lines, and only creates linestrings, so there
                    are no vertices of degree >2 (ie, no
                    junctions/forks). Also, the plug-in doesn't look for
                    intersections between vertices (since it only looks
                    to merge endpoints.)<br>
                    The StackExchange post appears to want
                    multi-linestrings, which gives forks and such. Is
                    that what you need? <br>
                    <br>
                    On 8/30/2021 5:27 AM, Nicolas Cadieux wrote:
                    <blockquote type="cite"> Hi,
                      <div>This is the plugin I was referring to.  I
                        don’t see it in the current plugins
                        (experimental turned on)  so I figured it’s QGIS
                        2 only.<br>
                        <div><br>
                        </div>
                        <div><a
                            href="https://github.com/ArMoraer/QGISMergeLines"
                            target="_blank" moz-do-not-send="true">https://github.com/ArMoraer/QGISMergeLines</a><br>
                          <br>
                          <div dir="ltr">Nicolas Cadieux
                            <div><a href="https://gitlab.com/njacadieux"
                                target="_blank" moz-do-not-send="true">https://gitlab.com/njacadieux</a></div>
                          </div>
                          <div dir="ltr"><br>
                          </div>
                        </div>
                      </div>
                    </blockquote>
                    <br>
                  </div>
                </blockquote>
              </div>
            </div>
          </div>
          _______________________________________________<br>
          Qgis-user mailing list<br>
          <a href="mailto:Qgis-user@lists.osgeo.org" target="_blank"
            moz-do-not-send="true">Qgis-user@lists.osgeo.org</a><br>
          List info: <a
            href="https://lists.osgeo.org/mailman/listinfo/qgis-user"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
          Unsubscribe: <a
            href="https://lists.osgeo.org/mailman/listinfo/qgis-user"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
        </blockquote>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Nicolas Cadieux
<a class="moz-txt-link-freetext" href="https://gitlab.com/njacadieux">https://gitlab.com/njacadieux</a></pre>
  </body>
</html>