• geos_buffer() returns a polygon or multipolygon geometry.

  • geos_offset_curve() returns a linestring offset to the left by distance.

geos_buffer(geom, distance, params = geos_buffer_params())

geos_offset_curve(geom, distance, params = geos_buffer_params())

geos_buffer_params(
  quad_segs = 30,
  end_cap_style = c("round", "flat", "square"),
  join_style = c("round", "mitre", "bevel"),
  mitre_limit = 1,
  single_sided = FALSE
)

Arguments

geom

A GEOS geometry vector

distance

The buffer distance. Can be negative to buffer or offset on the righthand side of the geometry.

params

A geos_buffer_params()

quad_segs

The number of segments per quadrant. A higher number here will increase the apparent resolution of the resulting polygon.

end_cap_style

One of "round", "flat", or "square".

join_style

One of "round", "mitre", or "bevel".

mitre_limit

If join_style is "mitre", the relative extent (from zero to one) of the join.

single_sided

Use TRUE to buffer on only the right side of the geometry. This does not apply to geos_offset_curve(), which is always one-sided.

Value

A GEOS geometry vector along the recycled length of geom and distance.

Examples

geos_buffer("POINT (0 0)", 1)
#> <geos_geometry[1]>
#> [1] <POLYGON [-1 -1...1 1]>
geos_offset_curve("LINESTRING (0 0, 0 10, 10 0)", 1)
#> <geos_geometry[1]>
#> [1] <LINESTRING [-1 0...10.707 11]>