st_startpoint | R Documentation |
Return the start and end points from lines
st_startpoint(x)
st_endpoint(x)
x |
line of class |
see https://postgis.net/docs/ST_StartPoint.html and https://postgis.net/docs/ST_EndPoint.html.
sf
object representing start and end points
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.