[R-sig-Geo] e00 to SpatialPolygons: how to set the correct projection
Paul Hiemstra
p.hiemstra at geo.uu.nl
Mon Jan 26 12:06:22 CET 2009
Hi!
Please checkout the spTransform() command which allows you to reproject
your sp objects (it is located in the rgdal package). Small example:
library(gstat)
data(meuse)
coordinates(meuse) = ~x+y
# Set the current projection
proj4string(meuse) = CRS("+init=epsg:28992")
#set new projection
meuse_newcrs = spTransform(meuse, CRS("+proj=longlat +ellps=WGS84
+datum=WGS84 +no_defs +towgs84=0,0,0"))
cheers and hth,
Paul
Hans-Jörg Bibiko wrote:
> Hi,
>
> I was able to convert an e00 file to a SpatialPolygons object (thanks
> a lot to everybody who was involved to set up this functionality!) by
> using 'e00toavc' and 'pal2SpatialPolygons'.
>
> But now I'm a bit lost in conversion. How to set the correct
> projection which is needed for 'pal2SpatialPolygons'?
>
> My prj.adf file says:
>
> Projection LAMBERT
> Zunits NO
> Units METERS
> Spheroid CLARKE1866
> Xshift 0.0000000000
> Yshift 0.0000000000
> Parameters
> 25 0 0.000 /* 1st standard parallel
> 47 0 0.000 /* 2nd standard parallel
> 110 0 0.000 /* central meridian
> 10 0 0.000 /* latitude of projection's origin
> 0.00000 /* false easting (meters)
> 0.00000 /* false northing (meters)
>
> and I want to use the data together with Roger Bivand's
> "http://spatial.nhh.no/R/etc/TM_WORLD_BORDERS_SIMPL-0.2.RData" data
> whose proj4string is set to
>
> "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"
>
>
> I tried:
> NMG <- pal2SpatialPolygons(arcs,pal, IDs=IDs, proj4string =
> CRS("+proj=longlat +ellps=clrk66"))
>
> but it ended in:
>
> Error in validityMethod(object) :
> Geographical CRS given to non-conformant data
>
>
> If I skip the proj4string in 'pal2SpatialPolygons' I get
> NMG at bbox
> min max
> r1 -1037807 1141001
> r2 3093775 4892464
>
>
> By looking at this bbox and the actual area given in the e00 file I
> image that the bbox should be:
> min max
> r1 103.7807 114.1001
> r2 30.93775 48.92464
>
>
>
> Many thanks for any hint in advance!
>
> Best,
>
> --Hans
>
> **********************************************************
> Hans-Joerg Bibiko
> Max Planck Institute for Evolutionary Anthropology
> Department of Linguistics
> Deutscher Platz 6 phone: +49 (0) 341 3550 341
> D-04103 Leipzig fax: +49 (0) 341 3550 333
> Germany e-mail: bibiko at eva.mpg.de
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
--
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone: +31302535773
Fax: +31302531145
http://intamap.geo.uu.nl/~paul
More information about the R-sig-Geo
mailing list