Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

st_startpoint

Return the start and end points from lines


Description

Return the start and end points from lines

Usage

st_startpoint(x)

st_endpoint(x)

Arguments

x

line of class sf, sfc or sfg

Details

Value

sf object representing start and end points

Examples

library(sf)
m = matrix(c(0, 1, 2, 0, 1, 4), ncol = 2)
l = st_sfc(st_linestring(m))
lwgeom::st_startpoint(l)
lwgeom::st_endpoint(l)
l2 = st_sfc(st_linestring(m), st_linestring(m[3:1, ]))
lwgeom::st_startpoint(l2)
lwgeom::st_endpoint(l2)

lwgeom

Bindings to Selected 'liblwgeom' Functions for Simple Features

v0.2-6
GPL-2
Authors
Edzer Pebesma [aut, cre] (<https://orcid.org/0000-0001-8049-7069>), Colin Rundel [ctb], Andy Teucher [ctb], liblwgeom developers [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.