[R-sig-Geo] rgdal package for mac
Gabriele Cozzi
gab.cozzi at gmail.com
Thu May 17 10:05:47 CEST 2012
Dear all,
I am having issues installing the package "rgdal" on a Mac OS X (Lion).
# install.packages("rgdal")
actually says that there is no available package for R 2.15.0 (the
version I am using at the moment). Yet I can successfully load the rgdal
package on my old PC (also running R 2.15.0). Does it means rgdal is not
implemented for mac? I find it hard to believe.
Any help would be appreciated.
Best,
Gabriele
============================================================
Gabriele Cozzi
Institute of Evolutionary Biology and Environmental Studies
Zurich University
Winterthurerstr. 190
8057 Zurich - Switzerland
E-mail: gabriele.cozzi at uzh.ch
Phone: ++41(0)44 6356116
Fax: ++41(0)44 6355711
http://www.ieu.uzh.ch
http://african-carnivores.com
Botswana Predator Conservation Trust
Private Bag 13
Maun - Botswana
E-mail: gab.cozzi at gmail.com
Mobile: +26774259312
http://www.bpctrust.org
On 17.05.2012 09:15, Roger Bivand wrote:
> On Thu, 17 May 2012, Hodgess, Erin wrote:
>
>> Hello again.
>>
>> I'm having a little bit of trouble with spTransform (probably I'm
>> doing it wrong), but here is what I'm doing:
>>
>>
>> Original data frame with UTM locations near Phuket, Thailand:
>>> test1.df
>> Loc east north
>> 1 a 748.168 602.861
>> 2 b 754.302 615.609
>>> proj1 <- CRS("+proj=utm +zone=47N")
>
> Your points are 750m east and 600m north of the given projection
> origin. If you meant km, set the units by adding +units=km to the
> proj4string. However, this gives me:
>
> coordinates Loc
> 1 (101.24, 5.44994) a
> 2 (101.295, 5.56496) b
>
> which is not on Phuket, so something else is wrong here. Do you know
> definitely that the input coordinates are UTM zone 47? Reversing the
> eastings and northings gets a bit closer:
>
>> proj1 <- CRS("+proj=utm +zone=47N +units=km")
>> coordinates(test1.df) <- c("north", "east")
>> proj4string(test1.df) <- proj1
>> spTransform(test1.df, CRS("+proj=longlat +datum=WGS84"))
> coordinates Loc
> 1 (99.9308, 6.7677) a
> 2 (100.046, 6.82295) b
>
> but isn't there yet (reversed coordinate order does happen). What was
> the source of the coordinates?
>
> Roger
>
>>> coordinates(test1.df) <- c("east","north")
>>> proj4string(test1.df) <- proj1
>>
>> Set up a spatial data frame
>>> test1.df
>> coordinates Loc
>> 1 (748.168, 602.861) a
>> 2 (754.302, 615.609) b
>>> spTransform(test1.df, CRS("+proj=longlat +datum=WGS84"))
>> coordinates Loc
>> 1 (94.518, 0.00543748) a
>> 2 (94.518, 0.00555246) b
>>>
>>
>> Now the answers should be about 8 degrees north and 98 degrees East.
>>
>> Any suggestions would be most appreciated.
>>
>> Sincerely,
>> Erin
>>
>>
>> Erin M. Hodgess, PhD
>> Associate Professor
>> Department of Computer and Mathematical Sciences
>> University of Houston - Downtown
>> mailto: hodgesse at uhd.edu
>>
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
More information about the R-sig-Geo
mailing list