5

I would like to buffer a set of lines with different distances to the NW, SW, SE, and NE. I have the distances stored in four attribute fields that correspond to the direction the buffer should be applied in. I have reviewed the two posts How to buffer a line with different distances for left/right sides and QGIS buffer polygon with different widths on each side but they do not fully address my issue. My lines do not flow East to West or North to South so the right/left side buffer option does not offer a solution.

Edit:I have attached a rough rendering of what I would like the output to be. The edges should be smooth.

enter image description here

  • Buffering a point in differing amounts by direction is pretty easy (and already solved). Buffering a line, well, I think you're on your own. – Vince Sep 12 '17 at 22:55
  • 2
  • That looks close. I only have access to open source GIS right now and am not proficient in Python. Should that script be easily transferred to QGIS Python console? – Kingfisher Sep 13 '17 at 17:08
  • 2
    That's the rub, really, because I certainly wouldn't want to code the next bit, of making a polygon from a line, and that algorithm isn't integrated into any GIS package. It would probably take me 2-3 more days of coding, if I didnt get tangled in topology issues (for reference, I've been a full-time GIS software engineer for 29 years; your time effort may vary). – Vince Sep 13 '17 at 18:46
  • A graphic of your input and desired output might be helpful so we fully understand your question. – klewis Sep 14 '17 at 15:57
0

This is an attempt by the Geometry generator; lacks nice smooth corners in your drawing, though.

convex_hull(
  make_line(
    project(start_point($geometry), 70, radians(45)),
    project(start_point($geometry), 20, radians(135)),
    project(start_point($geometry), 15, radians(225)),
    project(start_point($geometry), 50, radians(315)),
    project(  end_point($geometry), 70, radians(45)),
    project(  end_point($geometry), 20, radians(135)),
    project(  end_point($geometry), 15, radians(225)),
    project(  end_point($geometry), 50, radians(315))
  )
)

enter image description here

Second attempt: I am afraid below example is probably a dirty trick... debuffer and buffer by 5 meters...

buffer(
  buffer(
    convex_hull(
      make_line(
        project(start_point($geometry), 70, radians(45)),
        project(start_point($geometry), 20, radians(135)),
        project(start_point($geometry), 15, radians(225)),
        project(start_point($geometry), 50, radians(315)),
        project(  end_point($geometry), 70, radians(45)),
        project(  end_point($geometry), 20, radians(135)),
        project(  end_point($geometry), 15, radians(225)),
        project(  end_point($geometry), 50, radians(315))
     )
), -5), 5)

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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