powered by
Utility functions for accessing coordinates from a geometry.
coord_n(x, n)n_coords(x)coord_first(x)coord_last(x)
n_coords(x)
coord_first(x)
coord_last(x)
an object of class rs_POINT. Whereas n_coords() returns an integer vector of the same length as x.
rs_POINT
n_coords()
x
an object of class rsgeo
rsgeo
the index position of the coordinate
n_coords returns the total number of coordinates in a geometry
n_coords
coord_first() returns the first coordinate in a geometry
coord_first()
coord_last() returns the last coordinate in a geometry
coord_last()
coord_n() returns the nth coordinate in a geometry
coord_n()
lines <- geom_linestring(1:10, 1:10) n_coords(lines) coord_first(lines) coord_last(lines) coord_n(lines, 5)
Run the code above in your browser using DataLab