Extract locations of sf objects.
Arguments
- sfj
An
sf
object or can be converted tosf
bysf::st_as_sf()
.
Examples
pts = sf::read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun'))
sf_coordinates(pts)
#> X Y
#> [1,] 321692.1 4004615
#> [2,] 327093.8 3988283
#> [3,] 319413.4 3999016
#> [4,] 295859.7 4000298
#> [5,] 309115.1 4006437
#> [6,] 307693.8 4001200
#> [7,] 321477.5 3995153
#> [8,] 290924.8 4004432
#> [9,] 310613.7 4008916
#> [10,] 309759.1 3998739
#> [11,] 325896.0 3998749
#> [12,] 298140.7 4012911
#> [13,] 318763.3 3991847
#> [14,] 317858.4 3996996
#> [15,] 293307.1 3997893
#> [16,] 278505.6 4014720
#> [17,] 328858.7 3990305
#> [18,] 321005.4 4001505
#> [19,] 298956.9 4002763
#> [20,] 303136.9 4004695
#> [21,] 303160.4 4000267
#> [22,] 320048.3 3997191
#> [23,] 297232.5 4004157
#> [24,] 314715.6 4004529
#> [25,] 306744.7 3997831
#> [26,] 333088.5 3999333
#> [27,] 274308.9 4010571
#> [28,] 323286.8 3989089
#> [29,] 314776.0 3993128
#> [30,] 295539.1 3995591
#> [31,] 287423.3 4017138
#> [32,] 320535.1 4006257
#> [33,] 305948.2 3991115
#> [34,] 323973.5 4000410
#> [35,] 289667.1 4012704
#> [36,] 306876.0 4004700
#> [37,] 303835.1 4003091
#> [38,] 331003.9 3997742
#> [39,] 296185.7 4007332
#> [40,] 313987.7 4009508
#> [41,] 305798.0 3996370
#> [42,] 301551.3 3992609
#> [43,] 279032.9 4005677
#> [44,] 324950.1 3986925
#> [45,] 312107.6 3998811
#> [46,] 297161.8 3997411
#> [47,] 284636.8 4021080
#> [48,] 308876.5 4009625
#> [49,] 317285.2 3985330
#> [50,] 322264.5 3997923
#> [51,] 291737.8 4011071
#> [52,] 309791.9 4005098
#> [53,] 308641.6 3999711
#> [54,] 327504.6 3997160
#> [55,] 301821.4 4013119
#> [56,] 318552.1 3990024
#> [57,] 307580.2 3995293
#> [58,] 287731.3 4000289
#> [59,] 287216.1 4004408
#> [60,] 319133.0 3986907
#> [61,] 313478.1 4003469
#> [62,] 302109.9 3994967
#> [63,] 299651.2 4015360