v.buffer.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <h2>DESCRIPTION</h2>
  2. <em>v.buffer</em> creates a buffer around features of
  3. given <b>type</b>, which have a category in the
  4. given <b>layer</b>. The <b>tolerance</b> controls the number of vector
  5. segments being generated (the smaller the value, the more vector
  6. segments are generated).
  7. <h2>NOTES</h2>
  8. Internal buffers for areas can be generated with negative distance
  9. values ("inward buffer" or "negative buffer" or "shrinking").
  10. <p>
  11. <em>v.buffer</em> fusions the geometries of buffers by default.
  12. Categories and attribute table will not be transferred (this would
  13. not make sense as one buffer geometry can be the result of many
  14. different input geometries). To transfer the categories and
  15. attributes the user can set the <b>t</b> flag. This will result in
  16. buffers being cut up where buffers of individual input geometries
  17. overlap. Each part that is the result of overlapping buffers of
  18. multiple geometries will have multiple categories corresponding to
  19. those geometries, and multiple buffer areas can have the same
  20. category. The buffer for the input feature with category X can thus
  21. be retrieved by selecting all buffer areas with category X (see
  22. example below).
  23. <p>
  24. Buffers for lines and areas are generated using the algorithms from
  25. the GEOS library.
  26. <p>
  27. <i>For advanced users:</i> built-in buffer algorithm no longer
  28. desired, we use GEOS: If GRASS is not compiled with GEOS support
  29. or <a href="variables.html">environmental
  30. variable</a> <tt>GRASS_VECTOR_BUFFER</tt> is defined, then GRASS
  31. generates buffers using built-in buffering algorithm (which is still
  32. buggy for some input data).
  33. <p>
  34. The options <b>minordistance</b>, <b>angle</b>, <b>tolerance</b> are
  35. kept for backward compatibility and have no effect with GEOS buffering.
  36. <h3>Corner settings</h3>
  37. The following vector line related corners (also called "cap") exist:
  38. <ul>
  39. <li>no cap: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="v_buffer_no_cap.png" valign="middle" alt="line buffer: no cap"></li>
  40. <li>rounded cap: <img src="v_buffer_rounded_cap.png" valign="middle" alt="line buffer: rounded cap"></li>
  41. <li>square cap: <img src="v_buffer_square_cap.png" valign="middle" alt="line buffer: square cap"></li>
  42. </ul>
  43. By default <em>v.buffer</em> creates rounded buffers (blue color on
  44. figure below):
  45. <center>
  46. <img src="v_buffer_line.png">
  47. </center>
  48. Straight corners with caps are created by <b>-s</b> flag (red color on
  49. the figure below), while <b>-c</b> flag doesn't make caps at the ends of
  50. polylines (green color on the figure below):
  51. <center>
  52. <img src="v_buffer_line_s.png">
  53. <img src="v_buffer_line_c.png">
  54. </center>
  55. Using <b>-s</b> with a point vector map as input data, square buffers are
  56. created instead of round buffers.
  57. <center>
  58. <img src="v_buffer_point_s.png">
  59. </center>
  60. <!-- Only support by GRASS buffer
  61. Flag <b>-s</b> also influences corners around polygons (see red color
  62. on the figure below):
  63. <center>
  64. <img src="v_buffer_area.png">
  65. <img src="v_buffer_area_s.png">
  66. </center>
  67. -->
  68. <h2>EXAMPLES</h2>
  69. All examples are based on the North Carolina sample dataset.
  70. <h3>Buffer around input lines</h3>
  71. <div class="code"><pre>
  72. v.buffer input=roadsmajor output=roadsmajor_buffer type=line distance=100
  73. </pre></div>
  74. <center>
  75. <img src="v_buffer_lines.png" border="1"><br>
  76. Buffer of 100m along the "roadsmajor" lines (map subset, original center line
  77. shown in black)
  78. </center>
  79. <h3>Circles around input points</h3>
  80. <div class="code"><pre>
  81. v.buffer input=hospitals output=hospitals_circled type=point distance=2000
  82. </pre></div>
  83. <center>
  84. <img src="v_buffer_points.png" border="1"><br>
  85. Buffer of 2000m around the "hospitals" points (map subset, original points
  86. shown in black, new area centroids in red)
  87. </center>
  88. <h3>Circles around input points with attribute transfer</h3>
  89. <div class="code"><pre>
  90. v.buffer input=hospitals output=hospitals_circled type=point distance=1000 -t
  91. # display buffer around hospital with category 36,
  92. # this buffer is composed of several areas:
  93. d.vect map=hospitals_circled type=area layer=1 cats=36
  94. # extract this buffer, dissolving boundaries
  95. v.extract in=hospitals_circled output=hospital_36_circled layer=1 cats=36 -d
  96. </pre></div>
  97. <h3>Buffer around input areas</h3>
  98. <div class="code"><pre>
  99. v.buffer input=lakes output=lakes_buffer type=area distance=100
  100. </pre></div>
  101. <center>
  102. <img src="v_buffer_areas.png" border="1"><br>
  103. Buffer of 100m around the "lakes" polygons (map subset, original areas
  104. shown in black)
  105. </center>
  106. <h3>Buffer inside input areas</h3>
  107. In this example, an internal buffer ("inward buffer" or "negative buffer")
  108. is generated using a negative <b>distance</b> value:
  109. <div class="code"><pre>
  110. v.buffer input=lakes output=lakes_buffer type=area distance=-50
  111. </pre></div>
  112. <center>
  113. <img src="v_buffer_areas_int.png" border="1"><br>
  114. Internal buffer of 50m inside the "lakes" polygons (map subset, original areas
  115. shown in black) <br>
  116. Not all features are buffered, only the polygons that allow creation inside
  117. a topological cleaned polygon.
  118. </center>
  119. <h2>REFERENCES</h2>
  120. <ul>
  121. <li><a href="http://trac.osgeo.org/geos">GEOS Library</a></li>
  122. </ul>
  123. <h2>SEE ALSO</h2>
  124. <em>
  125. <a href="r.buffer.html">r.buffer</a>,
  126. <a href="v.parallel.html">v.parallel</a>,
  127. <a href="v.extract.html">v.extract</a>,
  128. <a href="v.type.html">v.type</a>,
  129. <a href="v.patch.html">v.patch</a>,
  130. <a href="v.db.connect.html">v.db.connect</a>
  131. </em>
  132. <h2>AUTHORS</h2>
  133. Radim Blazek<br>
  134. Rewritten by Rosen Matev (with support through the
  135. Google Summer of Code program 2008)<br>
  136. Rewritten by Markus Metz (2011, 2012)
  137. <!--
  138. <p>
  139. <i>Last changed: $Date$</i>
  140. -->