Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am moving from creating maps with Illustrator to making them with QGIS and actual data. One of the things I haven't been able to re-create in QGIS are the smooth curved lines I can get in Illustrator. I am not talking about Join and Cap Styles, but how an entire line is rendered.

I am looking for an answer that doesn't include exporting as SVG to Illustrator and finishing the map there.

Also, I realize they could be considered an inaccurate representation but, for the most part, these maps are for giving riders an idea of where they are and don't necessarily have to be an exact representation.

Here is an example of what I mean: enter image description here

share|improve this question
2  
How is your data stored? Most data formats (e.g. shapefile) do not allow for arcs. I beleive some databases now do though. –  Darren Cope Jan 12 '12 at 20:04

3 Answers 3

up vote 16 down vote accepted

Check out the Generalizer plugin, it should do what you want. The plugin has smoothing options which work quite well.

It doesn't change how your lines are rendered but instead makes a new shapefile with smoothing (or simplification/generalization) applied.

enter image description here

enter image description here

share|improve this answer
    
I can't find this plugin for QGIS 1.7.3 even though I have 3rd party repos enabled. Can you show how to enable/find it? Looks interesting and straightforward. –  SaultDon Jan 12 '12 at 21:54
2  
Strange. It should be in the plugin installer as it's coming from the main QGIS plugin repo. –  Nathan W Jan 12 '12 at 22:02
2  
You're right, but from the Python Plugin Installer I had to go to the options tab and change "Allowed Plugins" to: "Show all plugins, even those marked as experimental". –  SaultDon Jan 12 '12 at 22:58
    
I ended up playing with this plugin a little bit tonight and it actually worked better for me since I didn't have to use a GRASS layer and could just convert my current shapefile. –  Brian Kelly Feb 21 '12 at 5:18
    
I had to do it in two steps for my very detailed but jagged digitising: first simplify (eg Lang algorithm), and then smoothing. Worked a treat. –  a different ben Aug 12 '12 at 14:27

Using QGIS + GRASS plugin:

Add the Grass toolbar from the "Manage Plugins" window. add grass tools plugin to qgis

Your lines will need to be a grass vector, so convert them into a new or existing GRASS mapset.

From the GRASS toolbar, select GRASS Tools... enter image description here

Look for the module: v.generalize (WIKI tutorial here)

You can then choose several different generalizing algorithms: GRASS tool v.generalize algorithms selection

Note the algorithms: Chaiken, Hermite or even Sliding Average. There are several others as well!

The differences can be seen in the wiki pictures: v.generalize simplify differences example

from Wiki: "Note, that a difference between "Chaiken" and "Hermite" is that the lines produced by "Chaiken" "inscribe" the orginal lines whereas the "Hermite" lines "circumscribe" the original lines as can be seen in the picture [above]. (Black line is original line, green line is "Chaiken" and blue is "Hermite")


Using uDig + jgrasstools or grass:

If you have difficulty getting desirable results from GRASS's v.generalize, try the latest version of uDig with jgrasstools. You can also grab the grass jar from the same place as jgrasstools.

Once uDig is installed and up and running, enable the Spatial Toolbox: Window > Show View > Other... enable spatial toolbox in uDig

Un-dock the toolbar for easier readability (right-click Spatial Toolbox tab > Detach...): detaching spatial toolbox in uDig

Load the required jgrasstools and grass (optional) modules: loading jgrasstools/grass into udig

Don't forget to set your grass parameters (point to grass executable or bat file on windows, or grass command in linux ie, /usr/bin/grass) if you load the grass jar file as well: setting grass parameters in uDig

Finally! Using the tools from jgrasstools (not grass) you can generalize the line easily with Vector Processing > LineSmootherJaiTools Vector Processing to LineSmootherJaiTools in uDig

Be sure to set the input and output properly (works on Shapefiles only, so no need to convert your data to mapsets/locations for grass): input and output settings for Spatial Toolbox in uDig

Once done setting the smoothing tolerance (0.0 - 1.0) and input/output, press the Play button on the Spatial Toolbox window (top right): play module in Spatial Toolbox for uDig

Results:
uDig simplify jgrasstools results...

share|improve this answer
    
Does this alter the original data or does it filter it in a way before QGIS renders it? –  Brian Kelly Jan 12 '12 at 21:27
    
Ah, that is answered here: "(Line) smoothing is a "reverse" process which takes as input a line and produces a smoother approximate of the original. In some cases, this is achieved by inserting new vertices into the original line, and can total up to 4000% of the number of vertices in the original. In such an instance, it is always a good idea to simplify the line after smoothing." from grass.osgeo.org/grass64/manuals/html64_user/v.generalize.html –  Brian Kelly Jan 12 '12 at 21:29
    
So it seems like this is something you'd likely would apply once you've confirmed your lines are all correct and don't need further editing (unless you want to adjust all the additional vectors and then smooth it again) –  Brian Kelly Jan 12 '12 at 21:31
    
@spline Yea, because you have to work with a "grass dataset" which is essentially - NOT a shapefile, you would want to make sure the original shapefile was complete. Simplifying the line to eliminate extra vertices is an option as well depending on how long the line is and the amount of vertices present in the bezier curve. –  SaultDon Jan 12 '12 at 21:39
    
Thank you for such a quality answer! –  Brian Kelly Jan 13 '12 at 0:51

There is another way, possibly this way only since version QGIS 2.0:

Under Processing>Toolbox you can access GRASS and SAGA Tools. For smoothing, there you find v.generalize, but also line simplification from SAGA. These tools work on regular shapefiles, so no grass vector is needed:

enter image description here

Batch mode is not that good solved yet (right click in the right-hand menue and choose "Execute as batch", since one has to choose every single file manually. The generalizer plug-in mentioned further above lets one choose many files more simply, but this only works right now if one does not specify a file to save to, otherwise the plug in crashes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.