[R-sig-Geo] question about accessing geometry from an sf object
Erin Hodgess
er|nm@hodge@@ @end|ng |rom gm@||@com
Sun Aug 1 06:46:02 CEST 2021
Hello!
I have the following sf object:
> bt.cent
Simple feature collection with 8 features and 1 field
Geometry type: POINT
Dimension: XY
Bounding box: xmin: -105.0746 ymin: 38.97641 xmax: -104.7917 ymax: 39.82494
CRS: +proj=longlat +datum=WGS84 +no_defs
rnorm.10. geometry
1 0.3297790 POINT (-105.0746 38.97641)
2 NA POINT (-104.7917 38.97641)
3 -1.0734667 POINT (-105.0746 39.25925)
4 NA POINT (-104.7917 39.25925)
5 -0.1284898 POINT (-105.0746 39.5421)
6 -0.4071287 POINT (-104.7917 39.5421)
7 NA POINT (-105.0746 39.82494)
8 1.4171128 POINT (-104.7917 39.82494)
And I am accessing the geometry (to build covariances) as:
> bt.cent$geometry[[1]][1]
[1] -105.0746
> bt.cent$geometry[[1]][2]
[1] 38.97641
>
Is that the best way to handle the geometry items, please?
Thanks in advance,
Sincerely,
Erin
Erin Hodgess, PhD
mailto: erinm.hodgess using gmail.com
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list