This functions takes point geometries with class sfc from the sf package and returns a matrix representing x and y (typically lon/lat) coordinates.

sfc_point_to_matrix(x)

Arguments

x

An sfc object

Details

See https://github.com/dcooley/sfheaders/issues/52 for details

Author

Dave Cooley

Examples

sfc_point_to_matrix(od_data_centroids$geometry[1:6])
#>        [,1]     [,2]
#> 1 -1.609934 53.79079
#> 2 -1.624630 53.88605
#> 3 -1.518058 53.84066
#> 4 -1.502589 53.78754
#> 5 -1.521520 53.75969
#> 6 -1.548730 53.72793