Skip to content

Strange lines when projecting a world map

2 messages · Roger Bivand, Francesco Carotenuto

#
On Fri, 6 Dec 2013, Francesco Carotenuto wrote:

            
If you don't need the whole world, then it may make sense to project just 
the continents you do need, avoiding the lines running across the "back" 
of the map. Using wrld_simpl:

library(maptools)
data(wrld_simpl)
EAAw <- wrld_simpl[wrld_simpl$REGION==2 | wrld_simpl$REGION==142 |
  wrld_simpl$REGION==150,]
library(rgdal)
EAAwmoll <- spTransform(EAAw, CRS("+proj=moll +lon_0=66"))
plot(EAAwmoll)

or:

library(rworldmap)
data(countriesCoarse)
EAA <- countriesCoarse[grep("Asia|Europe|Africa", countriesCoarse$GBD),]
library(rgdal)
EAAmoll <- spTransform(EAA, CRS("+proj=moll +lon_0=66"))
plot(EAAmoll)

Both of these give Eurasia+Africa maps that can be projected without the 
stripe artefacts. I suggest doing this, and staying global on +lon_0=0 for 
the global datasets. The rworldmap package is better supported than the 
wrld_simpl dataset in maptools. All of them have geometry issues probably 
introduced under line generalisation from detailed coastlines. It may be 
possible to use maptools::Rgshhs() as an alternative, but here there are 
no country polygons.

Hope this helps,

Roger
PS. Your reply didn't reach the list, possibly because of a large 
attachment. On the list, it is best not to attach anything, but to provide 
a link to where the material can be accessed (3000 subscribers are not 
equally interested in all topics).