<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Harrissou,</p>
    <p>Turn out I had a float point error problem with the distance
      matrix tool that indicated I had no disconnected lines in my
      network.  The distance matrix tool reports 0 distance when the
      distance is around or below the 10th decimal point.   I have fixed
      the problem and dissolve followed by multipart to single part does
      work with lines like it does with polygons and does dissolve line
      ends.  I will report the error on the distance matrix tool that I
      was using to find my disconnected line nodes.</p>
    <p>Thanks for your help and for insisting I figure out problem.<br>
    </p>
    <p>Nicolas<br>
    </p>
    <div class="moz-cite-prefix">On 2021-08-31 11:20 p.m., Nicolas
      Cadieux wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:BB7814E5-5D9A-4A72-AD66-66102DE0FE76@gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      Hi,
      <div><br>
        <div>I will look at the wkt output but it seems that with lines,
          dissolve will just create a single huge multiline.  The multi
          part to single part will just split it back up.  I suspect
          that dissolve only deals with common border in polygones and
          not line ends.  Will test tomorrow to figure out more details.<br>
          <br>
          <div dir="ltr">Nicolas Cadieux
            <div><a href="https://gitlab.com/njacadieux"
                moz-do-not-send="true">https://gitlab.com/njacadieux</a></div>
          </div>
          <div dir="ltr"><br>
            <blockquote type="cite">Le 31 août 2021 à 03:57, DelazJ
              <a class="moz-txt-link-rfc2396E" href="mailto:delazj@gmail.com"><delazj@gmail.com></a> a écrit :<br>
              <br>
            </blockquote>
          </div>
          <blockquote type="cite">
            <div dir="ltr">
              <div dir="ltr">
                <div>Hi,</div>
                <div><br>
                </div>
                <div>> That does not work with lines unfortunately. I
                  tried multiple times with different combinations.  It
                  works with polygons when common borders need to be
                  dissolved.</div>
                <div><br>
                </div>
                <div>Nicolas, can you elaborate a bit more on the issues
                  you have with the "Dissolve + Multipart to
                  singleparts" solution I provided few days ago. At
                  which step is it failing? The dissolve does not merge
                  joining features into a single one? I don't know the
                  function internals but I'd expect it to work this way
                  and if not, would sound like a bug to report IMHO...</div>
                <div><br>
                </div>
                <div>Regards,</div>
                <div>Harrissou<br>
                </div>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">Le mar. 31 août 2021
                  à 00:57, Nicolas Cadieux <<a
                    href="mailto:njacadieux.gitlab@gmail.com"
                    moz-do-not-send="true">njacadieux.gitlab@gmail.com</a>>
                  a écrit :<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>
                    <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>On 2021-08-30 4:42 p.m., Charles Dixon-Paver
                      wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <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"
                            target="_blank" 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 cols="72">-- 
Nicolas Cadieux
<a href="https://gitlab.com/njacadieux" target="_blank" moz-do-not-send="true">https://gitlab.com/njacadieux</a></pre>
                  </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>
            </div>
          </blockquote>
        </div>
      </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>