[R-sig-Geo] Rotating with maptools::ellide()

Agustin Lobo alobolistas at gmail.com
Sun Dec 23 11:56:24 CET 2012


Roger,

On Sat, Dec 15, 2012 at 11:06 PM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
> On Sat, 15 Dec 2012, Agustin Lobo wrote:
>
>> 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
>
>
> Plrease provide a motivation - elide methods are not intended to elide parts
> of data sets.
My polygons are rectangles that represent the ideal footprints of
aerial images acquired from a UAV.
I want to rotate in order to visualize different positions of the
camera in the UAV.

>Please also provide the code for copy and paste, withou having
> to discard the leading prompts. If you need a different function, why not
> write one as a loop over elide - although then there will be absolutely no
> chance that your output geometries will be planar, so things like plotting
> just will not work as expected where entities overlap.
Yes, a loop is the obvious solution, I just thought ellide() would actually
provide the option of individual rotation by providing on center point
of rotation for each
polygon.

Thanks

Agus



More information about the R-sig-Geo mailing list