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.

How can I buffer a line in QGIS using one attribute for the left side of the line and one attribute for the right side of the line? I am trying to buffer a river with its bank width, which is different on the right and left side.

share|improve this question
    
have you tried to use JTS buffer from QGIS? lin-ear-th-inking.blogspot.it/2010/11/… –  julien yesterday

2 Answers 2

Defining a line's side is rather straight forward on an orientable surface, which a 2D plane in a GIS is. If you define a start point and an end point for a line, you can unambiguously define "left" and "right" sides. This is the case even if the line crosses itself.

From a more practical standpoint, simple workflow for creating a one-sided buffer includes a standard buffer, a difference operation, and then a clipping operation. Here's an example.

Start by creating a polygon that includes, or precisely overlaps, your line. In order for the buffer to be on the right side of your line the inside of the polygon should be on the left. Note that if your line crosses itself then this won't work as desired, and you may need to draw the polygon such that it doesn't cross itself or your line. Apply the buffer operation to this polygon. Using the fTools plugin go to Geoprocessing Tools > Buffer.

Polygon

Using the difference operation, Geoprocessing Tools > Difference, with the buffer as the input layer and the original polygon as the difference layer, cut out the inside. Now you have a right-side buffer.

Buffered polygon

All that remains is to clip the "extra" part of the polygon. Geoprocessing Tools > Clip.

Polygon clip Final line

share|improve this answer

This is a very interesting question, which I believe is non trivial to solve. I came across a script for ArcMap which provides a very nicely documented solution spanning 500 lines of VB code. However I am not aware of an equivalent script or module in QGIS.

One of the key considerations in an asymmetric buffer will be the direction of flow of the line, so that you can define a left and right side. In the case of rivers this should be straightforward to calculate if you have an accompanying DEM.

It may be possible to build a qgis script around the logic of this script, but that would require an extensive amount of work.

share|improve this answer
1  
In ArcMap this is very easy to achieve. In the tool dialog you have the parameter Side Type which can be either left or right. And you have the parameter Field. So scripting this tool allows you to use different values for both. I just recently did this (see my question here) –  LarsVegas Sep 14 '12 at 7:18

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.