12

I am working on a publication and would like to make my schematic visually pleasing. The amount of detail is too high and the image would be better If I could simplify and smooth my line and polygon vectors. Ideally it would minic smooth Bezier like curves. (Curves are not yet supported in QGIS so searching an alternative)

I've tried many many settings in QGIS, primarily the v.generalize tool but I either get errors or the results still has sharp corners.

enter image description here

A close up reveals the ugly sharp corners of the vectors. enter image description here

And I would like to get something like this: enter image description here

Is there a simple way to simplify the vectors into smooth lines? Alternativily, which settings in GRASS v.generalize should I use?

Related question: Is there a way to render lines with a smooth (bezier) curves in QGIS?

It seems like v.generalize with Chaiken algorithm could do the trick. Searching for the correct settings. (Trial and error)

Shapefiles can be found here

naught101
  • 496
  • 6
  • 19
RutgerH
  • 3,285
  • 3
  • 27
  • 55
  • 1
    Have you checked several plugins, namely SmoothLine and Cartographic Line Generalization? – Taras Feb 04 '19 at 13:54
  • QGis 3.4 has the tool "smoothgeometry" in the toolbox. This might be what you're looking for. – Erik Feb 04 '19 at 13:55
  • the build-in smooth function doesn't result in the desired output. I've tried multiple offset and angle settings. – RutgerH Feb 04 '19 at 13:59
  • Cartographic Line generalization just transposes my shapefile. Very odd. – RutgerH Feb 04 '19 at 14:04
  • Specify 1) would you like to smooth only hydrographic lines or even polygons? 2) or Do you only need a processing tool in QGIS? – Cyril Mikhalchenko Feb 04 '19 at 17:26
  • 1
    look at 2 options of hydrography of soft and rough force, maybe they will suit you...https://drive.google.com/file/d/1o5Hz_toFHBCFMoZiD2Wt6QfUuNizu7_c/view?usp=sharing – Cyril Mikhalchenko Feb 04 '19 at 19:31
  • 1
    This is usually a two step process: simplify the lines first to remove the unwanted detail, and then smooth the result – ndawson Feb 04 '19 at 19:46
  • @Cyril the result you obtained is a step in the right direction. Both versions still have sharp vertices though. The desired result is one without any sharp corners (exceptions at bifurcations). I think some pre-processing is required. I.e. merge each branch into a single line and simplify before smoothing. – RutgerH Feb 05 '19 at 10:22
  • I believe it is difficult to do this in automated mode, and perhaps better after an automated way to Refine the hydrographic elements for manual visualization... – Cyril Mikhalchenko Feb 05 '19 at 10:31
  • agreed. It would be cool if QGIS allowed to export a smooth, simplified version of the map for schematics in documents. – RutgerH Feb 05 '19 at 10:39

1 Answers1

21

You can use a geometry generator in styling as symbol layer style and smooth function. The advantage of this solution is that the geometry is intact.

Smooth 0: Geomoetry Generator - Smooth 0

Smooth 5: Geomoetry Generator - Smooth 5

BERA
  • 72,339
  • 13
  • 72
  • 161
GSienko
  • 1,071
  • 6
  • 8
  • this looks promising. The only issue is that my shapefile consists of multilines (I've added a download link). At each end of a single line, the corner remains sharp. I will probably have to merge/dissolve to get the result I want. – RutgerH Feb 05 '19 at 10:29
  • Is there a way to save/export the smooth(ed?) geometry as a new vector file? – BERA Mar 06 '20 at 14:29
  • 1
    @BERA in processing you will find generate geometry algorytm. – GSienko Mar 06 '20 at 14:42
  • It doesn't give very nice results for closed loops at the vertex where the loop closes. Is there anyway to improve this? – harry.kuril Mar 05 '23 at 19:12