[R-sig-Geo] mapproject

Agustin Lobo alobolistas at gmail.com
Wed Jun 30 20:25:21 CEST 2010


True, thanks. I actually think that I have used spTransform in the past.

The problem was that I searched the help system for "reprojection"
and "projection", and spTransform did not come up.
Maybe both keywords can be included in the documentation of spTransform ?

Agus

2010/6/30 Michael Sumner <mdsumner at gmail.com>:
> I think rgdal package would be the preferable way. There are some old
> and outdated map projection packages (I admittedly do not not the
> details, and use rgdal exclusively).
>
> library(rgdal)
> eugrd025DF.laea <- spTransform(eugrd025DF, CRS(projection(Br)))
>
> spTransform() handles all the details of back and forward transforming
> (see inv argument in project) so that valid CRS() projection strings
> can be used directly to specify reprojections.
>
> I'm not intimate yet with the raster package so I might have missed
> something that's possible in the way the CRS string is derived by
> projection, but if proj4string(eugrd025DF) gives the same value as
> projection(eugrd025DF) then the spTransform approach should be fine.
>
> Cheers, Mike.
>
> On Wed, Jun 30, 2010 at 10:51 PM, Agustin Lobo <alobolistas at gmail.com> wrote:
>> I have a SpPolDF in geographic coordinates (eugrd025DF) and must reproject it
>> to the projection of a raster object (Br):
>>> projection(eugrd025DF)
>> [1] "+proj=longlat +ellps=WGS84"
>>
>>> projection(Br)
>> [1] "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000
>> +ellps=GRS80 +units=m +no_defs"
>>
>> Can I do this with mapproject (package mapproj) os is it better to
>> export to shape file, reproject
>> with a GIS and import back? If it's possible/convenient, how to write
>> the parameters argument
>> in mapproject()?
>>
>> Thanks
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>



More information about the R-sig-Geo mailing list