lawn_circle: circle

View source: R/circle.R

lawn_circleR Documentation

circle

Description

Takes a data-Point and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision

Usage

lawn_circle(center, radius, steps = FALSE, units = "kilometers", lint = FALSE)

Arguments

center

The center, a data-Feature<(data-Point)>

radius

(integer) Radius of the circle.

steps

(integer) Number of steps.

units

(character) Miles, kilometers (default), degrees, or radians

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

Value

a data-Feature<(data-Polygon)>

See Also

Other assertions: lawn_dissolve(), lawn_tesselate()

Examples

pt <- '{
  "type": "Feature",
  "properties": {
    "marker-color": "#0f0"
  },
  "geometry": {
    "type": "Point",
    "coordinates": [-75.343, 39.984]
  }
}'

lawn_circle(pt, radius = 5, steps = 10)
## Not run: 
lawn_circle(pt, radius = 5, steps = 10) %>% view
lawn_circle(pt, radius = 4, steps = 10) %>% view
lawn_circle(pt, radius = 3, steps = 10) %>% view
lawn_circle(pt, radius = 10, steps = 10) %>% view
lawn_circle(pt, radius = 5, steps = 5) %>% view
lawn_circle(pt, radius = 5, steps = 4) %>% view

## End(Not run)

ropensci/lawn documentation built on May 18, 2022, 9:58 a.m.