Thank you for the answer. The object is the prediction location in an interpolation process. The function of "overlay" is involved in an automatic process and the longitude (and the kind of projection too) can change according to the dataset that is, in some cases, worldwide distributed.
Dr. Francesco Carotenuto (Ph.D.) Department of Earth Sciences Federico II University Largo S. Marcellino 10, 80138 NAPLES (ITALY) http://francesco-carotenuto.blogspot.it/ http://3dpaleontology.blogspot.it/ Il Giovedì 5 Dicembre 2013 21:23, Roger Bivand <roger.biv...@nhh.no> ha scritto: On Thu, 5 Dec 2013, Francesco Carotenuto wrote: > Dear list, as in > the title, I found that when projecting a world map by mollweide projection > and > setting a?? longitude value, some strange > parallels are drawn. The real problem is that these lines ???interact??? with > a > raster when performing the ???over??? function. > How can I manage > it? The underlying question is what you want to do with the objects after projection. The problem in your example is that some polygons/lines cross -180+66 degrees, so get reflected back across. A possible solution is to clip the polygons before projection at -180+66 degrees +/- a small number, but before looking at this in more detail, I need to know what the projected object is intended for. When +lon_0=0, there is no such effect, as this data set is clipped at -180 already. Roger > Here I provide a > simulated example to let you understand what I mean > Thanks.?? > > > #Example of a > world map mollweide projection with a specific longitude value > library(sp) > library(maptools) > library(rgdal) > data(wrld_simpl) > w_pol<-wrld_simpl > w_pol<-spTransform(w_pol, > CRS("+proj=moll +lon_0=66")) > plot(w_pol) > ?? > # Intersecting a > grid with the projected world map > gr<-expand.grid(x > = seq(-180, 180, length.out = 100), y = seq(-90, 90, length.out = 100)) > coordinates(gr)<-~x+y > proj4string(gr)<-CRS("+proj=longlat > +ellps=WGS84 +datum=WGS84 +no_defs") > gr<-spTransform(gr, > CRS("+proj=moll +lon_0=66")) > plot(gr[w_pol,]) > ?? > > ?? > Dr. Francesco Carotenuto (Ph.D.) > Department of Earth Sciences > Federico II University > Largo S. Marcellino 10, > 80138 NAPLES (ITALY) > http://francesco-carotenuto.blogspot.it/ > http://3dpaleontology.blogspot.it/?? > [[alternative HTML version deleted]] > > -- Roger Bivand Department of Economics, Norwegian School of Economics, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: roger.biv...@nhh.no [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo