[R-sig-Geo] problems drawing a world map on a levelplot

Tom Roche Tom_Roche at pobox.com
Wed Dec 19 18:38:12 CET 2012


https://stat.ethz.ch/pipermail/r-sig-geo/2012-December/017014.html
(rearranged)
> following your code I think you are not setting the CRS of your
> RasterBrick.

True, but since it was also global data, brick(...) "did the right
thing." I have now set its CRS just to be sure.

> Instead of:

> global.map.proj <- CRS('+proj=latlon +ellps=WGS84')

> you should try:

> global.map.proj <- CRS('+proj=longlat +ellps=WGS84')

Thanks again, but please note that I was following (see starred line)

http://rastervis.r-forge.r-project.org/#levelplot
>> let's add the administrative borders. This information is available
>> at the GADM service.

>> library(maptools)
** proj <- CRS('+proj=latlon +ellps=WGS84')
>> ##Change to your folder
>> mapaSHP <- readShapeLines('~/Datos/ESP_adm/ESP_adm2.shp', proj4string=proj)
>> p <- levelplot(SISmm, layers=1, FUN.margin=median)
>> p + layer(sp.lines(mapaSHP, lwd=0.8, col='darkgray'))

...

> Date: 2012-08-10
> Author: Oscar Perpiñán Lamigueiro

Perhaps you could fix that?

TIA, Tom Roche <Tom_Roche at pobox.com>



More information about the R-sig-Geo mailing list