0

I would like to expand a line to a wider polygon. Add 10 meter on both sides of the line for example.

Here is an example of what I would like

Take this line

enter image description here

And expand it to a wider polygon, like this

enter image description here

I did this manually, is there a way to do this automaticly? Changing the KML or using a program?

Thanks

Vincent

Vinzcent
  • 1,438
  • 6
  • 33
  • 59
  • possible duplicate of [Length buffer around polyline](http://stackoverflow.com/questions/7685633/length-buffer-around-polyline) – geocodezip May 22 '14 at 17:31
  • possible duplicate of [Algorithm - How to build a polygon around a polyline](http://stackoverflow.com/questions/5777074/algorithm-how-to-build-a-polygon-around-a-polyline) – geocodezip May 22 '14 at 17:32
  • possible duplicate of [An effective algorithm for buffering a polyline to create a polygon?](http://stackoverflow.com/questions/487504/an-effective-algorithm-for-buffering-a-polyline-to-create-a-polygon) – geocodezip May 22 '14 at 17:32
  • Or you could increase the stroke width of the polyline (but you can't specify that in meters). – geocodezip May 22 '14 at 17:33

1 Answers1

0

Depending on how accurate you need this – this is not trivial.

One possible algorithm could be:

for each segment do
    expand segment to rectangle with width 2r
    targetShape.join(rectangle)
next
for each point do
    expand point to circle with radius r
    targetShape.join(circle)
next
targetShape.outerHull(precision)

Each single line in this routine is tricky and depends on your expectations.

You could leave out the circles and instead make the rectangles longer, but this wil not work on sharp turns.

All of this involves ugly calculations to figure orthogonal lines etc.

You could try it in an graphic tool, gimp or inkskape :-)

Jan
  • 1,042
  • 8
  • 22