g_buffer()
builds a new geometry containing the buffer region around
the geometry on which it is invoked. The buffer is a polygon containing
the region within the buffer distance of the original geometry.
Arguments
- wkt
Character. OGC WKT string for a simple feature 2D geometry.
- dist
Numeric buffer distance in units of the
wkt
geometry.- quad_segs
Integer number of segments used to define a 90 degree curve (quadrant of a circle). Large values result in large numbers of vertices in the resulting buffer geometry while small numbers reduce the accuracy of the result.
Examples
g_buffer(wkt = "POINT (0 0)", dist = 10)
#> [1] "POLYGON ((10 0,9.98629534754574 -0.523359562429438,9.94521895368273 -1.04528463267653,9.87688340595138 -1.56434465040231,9.78147600733806 -2.07911690817759,9.65925826289068 -2.58819045102521,9.51056516295153 -3.09016994374947,9.33580426497202 -3.583679495453,9.13545457642601 -4.067366430758,8.91006524188368 -4.53990499739547,8.66025403784439 -5,8.38670567945424 -5.44639035015027,8.09016994374947 -5.87785252292473,7.77145961456971 -6.29320391049837,7.43144825477394 -6.69130606358858,7.07106781186548 -7.07106781186547,6.69130606358858 -7.43144825477394,6.29320391049838 -7.77145961456971,5.87785252292473 -8.09016994374947,5.44639035015027 -8.38670567945424,5.0 -8.66025403784439,4.53990499739547 -8.91006524188368,4.067366430758 -9.13545457642601,3.583679495453 -9.33580426497202,3.09016994374947 -9.51056516295153,2.58819045102521 -9.65925826289068,2.07911690817759 -9.78147600733806,1.56434465040231 -9.87688340595138,1.04528463267654 -9.94521895368273,0.52335956242944 -9.98629534754574,0.0 -10,-0.523359562429436 -9.98629534754574,-1.04528463267653 -9.94521895368273,-1.56434465040231 -9.87688340595138,-2.07911690817759 -9.78147600733806,-2.58819045102521 -9.65925826289068,-3.09016994374947 -9.51056516295154,-3.583679495453 -9.33580426497202,-4.067366430758 -9.13545457642601,-4.53990499739547 -8.91006524188368,-5 -8.66025403784439,-5.44639035015027 -8.38670567945424,-5.87785252292473 -8.09016994374947,-6.29320391049837 -7.77145961456971,-6.69130606358858 -7.43144825477394,-7.07106781186547 -7.07106781186548,-7.43144825477394 -6.69130606358858,-7.77145961456971 -6.29320391049838,-8.09016994374947 -5.87785252292473,-8.38670567945424 -5.44639035015027,-8.66025403784439 -5,-8.91006524188368 -4.53990499739547,-9.13545457642601 -4.067366430758,-9.33580426497202 -3.58367949545301,-9.51056516295153 -3.09016994374947,-9.65925826289068 -2.58819045102521,-9.78147600733806 -2.0791169081776,-9.87688340595138 -1.56434465040231,-9.94521895368273 -1.04528463267654,-9.98629534754574 -0.523359562429442,-10 -0.0,-9.98629534754574 0.523359562429436,-9.94521895368273 1.04528463267653,-9.87688340595138 1.56434465040231,-9.78147600733806 2.07911690817759,-9.65925826289068 2.5881904510252,-9.51056516295154 3.09016994374947,-9.33580426497202 3.583679495453,-9.13545457642601 4.067366430758,-8.91006524188368 4.53990499739547,-8.66025403784439 5.0,-8.38670567945424 5.44639035015027,-8.09016994374948 5.87785252292473,-7.77145961456971 6.29320391049837,-7.43144825477395 6.69130606358858,-7.07106781186548 7.07106781186547,-6.69130606358858 7.43144825477394,-6.29320391049838 7.77145961456971,-5.87785252292473 8.09016994374947,-5.44639035015028 8.38670567945424,-5 8.66025403784438,-4.53990499739547 8.91006524188368,-4.06736643075801 9.135454576426,-3.58367949545301 9.33580426497202,-3.09016994374948 9.51056516295153,-2.58819045102522 9.65925826289068,-2.0791169081776 9.78147600733806,-1.56434465040231 9.87688340595138,-1.04528463267654 9.94521895368273,-0.523359562429443 9.98629534754574,-0.0 10.0,0.523359562429431 9.98629534754574,1.04528463267653 9.94521895368273,1.56434465040231 9.87688340595138,2.07911690817759 9.78147600733806,2.5881904510252 9.65925826289068,3.09016994374947 9.51056516295154,3.583679495453 9.33580426497202,4.067366430758 9.13545457642601,4.53990499739547 8.91006524188368,4.99999999999999 8.66025403784439,5.44639035015027 8.38670567945424,5.87785252292473 8.09016994374948,6.29320391049837 7.77145961456971,6.69130606358858 7.43144825477395,7.07106781186547 7.07106781186548,7.43144825477394 6.69130606358859,7.77145961456971 6.29320391049838,8.09016994374947 5.87785252292473,8.38670567945424 5.44639035015028,8.66025403784438 5.0,8.91006524188368 4.53990499739547,9.135454576426 4.06736643075801,9.33580426497202 3.58367949545301,9.51056516295153 3.09016994374948,9.65925826289068 2.58819045102522,9.78147600733806 2.0791169081776,9.87688340595138 1.56434465040231,9.94521895368273 1.04528463267654,9.98629534754574 0.523359562429444,10 0))"