[Rspatial-devel] proj4string<-

Edzer Pebesma edzer.pebesma at uni-muenster.de
Tue Mar 27 14:31:15 CEST 2012


I discovered today than a student assumed that in the following sequence:

xx = readOGR('whatever shapefile')
proj4string(xx) = "new proj4 string"

would project to the new projection. The logic is that of

coordinates(meuse) = c("x", "y")

It doesn't, but also doesn't say it doesn't.

https://stat.ethz.ch/pipermail/r-sig-geo/2012-March/014666.html

is another case of the same assumption.

I suggest to modify proj4string<- such that when it is called with a
CRS, and the object already has a (non-NA) CRS, a message is printed
that sais sth like:

"A new CRS was assigned to an object with an existing CRS, without
reprojecting. For reprojection, use function spTransform in package rgdal".
-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de


More information about the Rspatial-devel mailing list