[R-sig-Geo] Rotating with maptools::ellide()
Agustin Lobo
alobolistas at gmail.com
Sat Dec 15 21:40:24 CET 2012
Given an SpPolDF, if I rotate the first polygon with
delme <- elide(testAlfacs20120626footp[1,], rotate=-90)
I get the result shifted. I get the rotation I was expecting by indicating the
coordinates of the center:
delme <- elide(testAlfacs20120626footp[1,],
rotate=-90,center=coordinates(testAlfacs20120626footp[1,]))
How could I rotate all polygons, each one around its own centroid?
I've tried
> delme <- elide(testAlfacs20120626footp, rotate=-90,center=coordinates(testAlfacs20120626footp))
Error in .local(obj, ...) : center must be numeric of length two
Thanks,
Agus
Data: http://dl.dropbox.com/u/3180464/testAlfacs20120626footp.rda
> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: i686-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=C
attached base packages:
[1] grid stats graphics grDevices utils datasets
methods base
other attached packages:
[1] maptools_0.8-20 lattice_0.19-30 foreign_0.8-51 zoo_1.7-7
chron_2.3-39 raster_2.0-25
[7] rgdal_0.7-22 sp_1.0-2
loaded via a namespace (and not attached):
[1] tools_2.15.2
More information about the R-sig-Geo
mailing list