[GIS] Making lines curvy in QGIS

flowlineqgisqgis-pluginsvisualisation

In QGIS I am working on a map with lines connecting locations created with the MMQGIS plugin. Is there an easy way to make those direct lines somewhat curvy for aesthetic purposes?

I'm trying to achieve something like the map below but with several hubs. I have read suggestions on how to do this with PostGIS and other advanced tools, so I've done my research (including other posts here) and tried using several plugins, and I'm specifically asking for an easy solution because I don't have much experience.

Example

Best Answer

Use Arrows style instead of Simple Line style.

For example, these lines with Simple Line style:

enter image description here

look like this with Arrow style:

enter image description here

You can turn off the arrow heads by setting the head width and length to 0.

As you can see, the straight line becomes a straight arrow, while the lines with a middle vertex become curved arrows. The placement of the middle vertex determines the curve of the arrow.

To convert your straight lines to curved arrows, you'll need to add a middle vertex to every line, and then offset that vertex enough to generate a curved arrow.

Use the Geometry Generator style with Geometry type: Linestring. This expression will create a line with a midpoint 200 distance units to the east and north of the original midpoint of the line.

  make_line( start_point( $geometry), translate( centroid( $geometry), 200,200), end_point($geometry))

Change the line to display as an Arrow style. Adjust the centroid offset values in the geometry generator expression until you're happy with the shape of the arrows. If you want, you can make them proportional to the length of the original line, eg $length/10. The full expression would be:

make_line( start_point( $geometry), translate( centroid( $geometry), $length/10, $length/10), end_point($geometry))

Here's what it looks like, with the original lines in pink and the geometry-generated arrows in black:

enter image description here

If you aren't satisfied with the line midpoint placement, you can adjust them manually. First, convert the geometry generated line style into an actual layer. Copy the expression from the geometry generator into the geometry by expression tool (Processing toolbox). Then use the Vertex Tool (Digitizing toolbar) to manually move the vertices.

Note: This answer was made with QGIS 3.4.

Related Question