# world map problem with Mollweide projection

4 messages
Open this post in threaded view
|

## world map problem with Mollweide projection

 Dear all, Anybody knows a easy way how to get rid of those east-west lines at the north in the following plot: library(maps) map('world',, projection='mollweide') best regards, Elias _______________________________________________ R-sig-Geo mailing list [hidden email] https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Open this post in threaded view
|

## Re: world map problem with Mollweide projection

 Administrator On Mon, 6 Nov 2017, Elias T Krainski wrote: > Dear all, > > Anybody knows a easy way how to get rid of those east-west lines at the north > in the following plot: > > library(maps) > map('world',, projection='mollweide') In sp (can be done in sf too, I think): wrld <- map("world", fill=TRUE, plot=FALSE) library(sp) library(maptools) ID <- sapply(strsplit(wrld\$names, ":"), "[", 1L) wrld_sp <- map2SpatialPolygons(wrld, ID=ID) proj4string(wrld_sp) <- "+proj=longlat +datum=WGS84" wrld_sp1 <- nowrapSpatialPolygons(wrld_sp, offset=180) library(rgdal) wrld_moll <- spTransform(wrld_sp1, CRS("+proj=moll")) plot(wrld_moll) The lines or polygons crossing 180 degrees need to be broken into two parts at 180 +/- eps; that isn't easy in the maps package. Roger > > best regards, > > Elias > > _______________________________________________ > R-sig-Geo mailing list > [hidden email] > https://stat.ethz.ch/mailman/listinfo/r-sig-geo> -- Roger Bivand Department of Economics, Norwegian School of Economics, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; e-mail: [hidden email] Editor-in-Chief of The R Journal, https://journal.r-project.org/index.htmlhttp://orcid.org/0000-0003-2392-6140https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en_______________________________________________ R-sig-Geo mailing list [hidden email] https://stat.ethz.ch/mailman/listinfo/r-sig-geo Roger Bivand Department of Economics Norwegian School of Economics Helleveien 30 N-5045 Bergen, Norway