[R-sig-Geo] polygon wraps around the world after re-projection

Carsten Dormann carsten.dormann at ufz.de
Tue May 24 15:06:07 CEST 2011


Dear fellow R-ists,

I run into problems after re-projecting a world map because one polygon 
now wraps around the world. Is there a way to re-define (or cut in two) 
the offending polygon?


require(maptools)
require(rgdal)
data(wrld_simpl)
wrld2 <- spTransform(wrld_simpl, CRS("+proj=cea +lon_0=Central Meridian 
+lat_ts=Standard Parallel +x_0=False Easting +y_0=False Northing")) # 
change to Lamberth cylindrical equal area projection

plot(wrld2) # notice the horizontal lines in the polar North!
	
I then moved the 0-longitude towards 11.7° in order to put the breaking 
line right between Russia and Alaska.

wrld3 <- spTransform(wrld_simpl, CRS("+proj=cea +lon_0=11.7 
+lat_ts=Standard Parallel +x_0=False Easting +y_0=False

plot(wrld3)

But there still is a little Aleutian island messing up the picture.

Notice that also wrld_simpl_lessIslands in rworldmap does not solve this 
problem: there always is a wrapping polygon somewhere!

I would also happily delete it, but wouldn't know how to find the 
respective polygon within the USA (slot 209) polygons.

Any help most appreciated!

Cheers,

Carsten



-- 
Dr. Carsten F. Dormann
Department of Computational Landscape Ecology
Helmholtz Centre for Environmental Research-UFZ	
(Department Landschaftsökologie)
(Helmholtz Zentrum für Umweltforschung - UFZ)
Permoserstr. 15	
04318 Leipzig				
Germany

Tel: ++49(0)341 2351946
Fax: ++49(0)341 2351939
Email: carsten.dormann at ufz.de
internet: http://www.ufz.de/index.php?de=4205

Registered Office/Sitz der Gesellschaft: Leipzig
Commercial Register Number/Registergericht: Amtsgericht Leipzig, 
Handelsregister Nr. B 4703
Chairman of the Supervisory Board/Vorsitzender des Aufsichtsrats: MinR 
Wilfried Kraus
Scientific Managing Director/Wissenschaftlicher Geschäftsführer: Prof. 
Dr. Georg Teutsch
Administrative Managing Director/Administrativer Geschäftsführer: Dr. 
Andreas Schmidt



More information about the R-sig-Geo mailing list