[R-sig-Geo] [Q]: Converting SpatialPolygons with proj4string to spatstat owin

Michael Höhle Michael.Hoehle at stat.uni-muenchen.de
Wed Apr 22 22:11:20 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Dear R-Sig-Geo,

I have a simple -- and probably trivial question -- which originates
from a lack of understanding about projections.

The problem occurs when using maptools to read some shapefile for
Germany (available from http://www.cdc.gov/epiinfo/europe/) in the WGS84
system.

library("maptools")
de <- readShapeSpatial("gm.shp",proj4string=CRS("+proj=longlat
+datum=WGS84 +ellps=WGS84"))

When plotting these data with plot(de) Germany looks nice and normal.
However, when I convert these data to a spatstat "owin":

owin.de <- as(de, "owin")
plot(owin.de)

the projection information appears to be lost, because the map is
distorted now.

Is there an easy way to fix this problem?

Best regards,

Michael

- --
> > sessionInfo()
R version 2.8.1 (2008-12-22)
i386-apple-darwin8.11.1

locale:
C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rgdal_0.6-7     maps_2.1-0      spatstat_1.15-1 deldir_0.0-7
[5] gpclib_1.4-1    mgcv_1.4-1      maptools_0.7-21 sp_0.9-34
[9] foreign_0.8-29

loaded via a namespace (and not attached):
[1] grid_2.8.1      lattice_0.17-20 tcltk_2.8.1     tools_2.8.1
Warning message:
'DESCRIPTION' file has 'Encoding' field and re-encoding is not possible
> >

- --

Michael Höhle, Ph.D.
Department of Statistics
University of Munich
Ludwigstrasse 33
80539 Munich
Germany

Phone:    +49 89 2180 6404
Fax:      +49 89 2180 5040

Email: hoehle at stat.uni-muenchen.de
Homepage: http://www.stat.uni-muenchen.de/~hoehle
PGP public key id: 0xA9589121

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJ73noJenxFqlYkSERAvapAKDNTAxzAr7TFQhkUjqQnBOUvZFogACglyt3
71rdMKt6Hxvy9r0r44VTryQ=
=ks0C
-----END PGP SIGNATURE-----



More information about the R-sig-Geo mailing list