The geo_segment() type is useful as an efficient representation of line segments stored using column vectors.

geo_segment(
  x0 = double(),
  y0 = double(),
  x1 = double(),
  y1 = double(),
  srid = NA
)

Arguments

x0, y0, x1, y1

Values for the start and end coordinates.

srid

A spatial reference identifier, coerced to an integer by as_geo_srid(). These identifiers can and should be managed outside of geovctrs except for 0, which is interpreted as "not set".

Value

A new_geovctrs_segment()

Examples

plot(geo_segment(0, 0, 10, -10:10))