lawn_buffer: Buffer a feature

Description Usage Arguments Author(s) See Also Examples

View source: R/buffer.R

Description

Calculates a buffer for input features for a given radius.

Usage

1
lawn_buffer(input, dist, units = "kilometers", lint = FALSE)

Arguments

input

A data-Feature or data-FeatureCollection

dist

(integer/numeric) Distance used to buffer the input.

units

(character) Units of the dist argument. Can be miles, feet, kilometers (default), meters, or degrees.

lint

(logical) Lint or not. Uses geojsonhint. Takes up increasing time as the object to get linted increases in size, so probably use by default for small objects, but not for large if you know they are good geojson objects. Default: FALSE

Author(s)

Jeff Hollister hollister.jeff@epa.gov

See Also

Other transformations: lawn_bezier(), lawn_concave(), lawn_convex(), lawn_difference(), lawn_intersect(), lawn_merge(), lawn_simplify(), lawn_union()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# From a Point
pt <- '{
 "type": "Feature",
 "properties": {},
 "geometry": {
    "type": "Point",
    "coordinates": [-90.548630, 14.616599]
  }
}'
lawn_buffer(pt, 5)

# From a FeatureCollection
dat <- lawn_random(n = 100)
lawn_buffer(dat, 100)

# From a Feature
dat <- '{
 "type": "Feature",
 "properties": {},
 "geometry": {
     "type": "Polygon",
     "coordinates": [[
       [-112.072391,46.586591],
       [-112.072391,46.61761],
       [-112.028102,46.61761],
       [-112.028102,46.586591],
       [-112.072391,46.586591]
     ]]
   }
}'
lawn_buffer(dat, 1, "miles")

# buffer a point
lawn_buffer(lawn_point(c(-74.50,40)), 100, "meters")

lawn documentation built on Jan. 6, 2021, 5:07 p.m.