Calculates a buffer for input features for a given radius.

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

See also

Examples

# From a Point pt <- '{ "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [-90.548630, 14.616599] } }' lawn_buffer(pt, 5)
#> <Feature> #> Type: Polygon #> Bounding box: -90.6 14.6 -90.5 14.6 #> No. points: 66 #> Properties: NULL
# From a FeatureCollection dat <- lawn_random(n = 100) lawn_buffer(dat, 100)
#> <FeatureCollection> #> Bounding box: -179.9 -85.5 180.0 89.4 #> No. features: 100 #> No. points: 6600 #> Properties: NULL
# 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")
#> <Feature> #> Type: Polygon #> Bounding box: -112.1 46.6 -112.0 46.6 #> No. points: 74 #> Properties: NULL
# buffer a point lawn_buffer(lawn_point(c(-74.50,40)), 100, "meters")
#> <Feature> #> Type: Polygon #> Bounding box: -74.5 40.0 -74.5 40.0 #> No. points: 66 #> Properties: NULL