Quantcast
Channel: Connecting points by line number and code in QGIS - Geographic Information Systems Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by Matt for Connecting points by line number and code in QGIS

$
0
0

You could use this expression on a Geometry Generator symbol layer of type LineString:

with_variable('group', "code"||'_'||"line number",casewhen    $id = array_min(              array_agg(                  $id,                  group_by:=@group              )          )then      make_line(        array_agg(            expression:=$geometry,            group_by:=@group,            order_by:=$id        )    )end)

Groups are created by concatenating the "code", an underscore, and "line number" fields. This value is assigned to a variable for better maintainability.

The case statement is to ensure the line is rendered only once per group, rather than once for every point. See this thread for more details.

enter image description here


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>