[R-sig-Geo] extract lat-long pairs - slot "coords"
Brandon Payne
payneb at post.bgu.ac.il
Sun May 7 11:35:15 CEST 2017
I was able to get the coords to print to the R-console. Still need to
read the docs on the Polygon class to access them.
(It's not Golan$coords )
```{pseudo}
# download
"http://biogeo.ucdavis.edu/data/diva/adm/ISR_adm.zip",
# extract
unzip *.zip
```
```{r}
states <- readOGR("../includes/ISR_adm/ISR_adm1.shp", "ISR_adm1")
Golan <- subset(states, NAME_1 == "Golan")
## check
## based on http://stackoverflow.com/questions/25985395/how-to-subset-a-shapefile
dim(states)
dim(Golan)
Golan
```
>
An object of class "Polygon"
Slot "labpt":
[1] 35.64728 33.24579
Slot "area":
[1] 6.914819e-05
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] 35.63564 33.24520
[2,] 35.63712 33.24554
[3,] 35.64099 33.24652
[4,] 35.64528 33.24749
[5,] 35.65008 33.24818
[6,] 35.65404 33.24831
[7,] 35.65889 33.24823
[8,] 35.65992 33.24816
[9,] 35.65163 33.24443
[10,] 35.64420 33.24282
[11,] 35.63676 33.24432
[12,] 35.63564 33.24520
More information about the R-sig-Geo
mailing list