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

2012-12-19 Thread Oscar PerpiƱan
> 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') Pe

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

2012-12-19 Thread Tom Roche
Tom Roche Wed, 19 Dec 2012 13:52:38 -0500 >> How to best/easiest range-shift lon-lat data? Matt Landis Wed, 19 Dec 2012 14:09:57 -0500 > [raster::shift] will work, but [raster::rotate] is even easier Thanks! Now this code- global.proj <- CRS('+pro

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

2012-12-19 Thread Matt Landis
Whoops - shift will work, but rotate is even easier On Wed, Dec 19, 2012 at 2:08 PM, Matt Landis wrote: > library(raster) > ?shift > > > On Wed, Dec 19, 2012 at 1:52 PM, Tom Roche wrote: > >> >> summary: How to best/easiest range-shift lon-lat data? >> >> details: >> >> https://stat.ethz.ch/pi

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

2012-12-19 Thread Matt Landis
library(raster) ?shift On Wed, Dec 19, 2012 at 1:52 PM, Tom Roche wrote: > > summary: How to best/easiest range-shift lon-lat data? > > details: > > https://stat.ethz.ch/pipermail/r-sig-geo/2012-December/017011.html > > I happened to write [the following code, omitted] yesterday, which > > swit

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

2012-12-19 Thread Tom Roche
summary: How to best/easiest range-shift lon-lat data? details: https://stat.ethz.ch/pipermail/r-sig-geo/2012-December/017011.html > I happened to write [the following code, omitted] yesterday, which > switches the parts of wrld_simpl from < 0 longitude to the east > (Pacific view). Of course!

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

2012-12-19 Thread Tom Roche
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: > glo

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

2012-12-19 Thread Oscar PerpiƱan
Hello, Perhaps the problem could be related with the CRS setting you are using. Instead of: global.map.proj <- CRS('+proj=latlon +ellps=WGS84') you should try: global.map.proj <- CRS('+proj=longlat +ellps=WGS84') Besides, following your code I think you are not setting the CRS of your RasterBr

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

2012-12-18 Thread Michael Sumner
Here's a crack at a full example, sorry the clip/merge polygon stuff is a mess still. library(maptools) library(raster) ## first, do the jiggery pokery of wrld_simpl to ## convert from Atlantic to Pacific view xrange <- c(0, 360) yrange <- c(-90, 90) require(maptools) require(raster) require(rge

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

2012-12-18 Thread Michael Sumner
I meant "wrld_simpl2 version like the maps package has". On Tue, Dec 18, 2012 at 8:54 PM, Michael Sumner wrote: > I happened to write this yesterday, which switches the parts of > wrld_simpl from < 0 longitude to the east (Pacific view). I haven't > investigated what you need in detail, so just i

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

2012-12-18 Thread Michael Sumner
I happened to write this yesterday, which switches the parts of wrld_simpl from < 0 longitude to the east (Pacific view). I haven't investigated what you need in detail, so just ignore if I'm off track. It's not careful about data or anything, since all I needed was the raw geometry. It might be o

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

2012-12-18 Thread Tom Roche
summary: I've tried several ways to draw wrld_simpl over global data plotted with rasterVis::levelplot, but keep encountering the same problem: - only the eastern hemisphere of the map plots - the eastern hemisphere of the map overlays the western hemisphere of the data How to fix? or otherwi