[R] map - mapproj : problem of states localisation

Tom Minka tpminka at media.mit.edu
Thu Nov 15 15:53:37 CET 2007


I haven't seen the original code, but the problem with Ray's code is that
the two projections are not synchronized.  Specifically, they are using
different (default) values for the orientation.  To synchronize the
projections, either specify the orientation parameter for both, or the
second one should use proj="", as follows:

map("france", proj="lambert", pa=c(30, 60))
map("world", proj="", lwd=1, col="red", add=TRUE)  # reuse previous
projection

Tom

> -----Original Message-----
> From: Ray Brownrigg [mailto:Ray.Brownrigg at mcs.vuw.ac.nz]
> Sent: 14 November 2007 21:03
> To: Amandine Chevalier
> Cc: r-help at r-project.org; tpminka at media.mit.edu
> Subject: Re: [R] map - mapproj : problem of states localisation
> 
> On Wed, 14 Nov 2007, Amandine Chevalier wrote:
> > Thank you very much for your help,
> >
> > I work about my code so as to give you the example (attached file) :
> >
> > In the first case (azequalarea projection), france from the "france"
> map
> > and from the "world" map are well superimposed, whereas in the second
> case
> > (lambert projection), it is not. However, due to projections I used
> to
> > produce my data, it would be better to use the lambert
> projection...That is
> > not only a problem of boundaries that do not line up...it is like the
> map
> > of France (it would be the same with the Italy's map) was centered on
> the
> > figure without taking into account the lat-long...Can I also trust
> the
> > location of the world map ?
> >
> > Do you have any idea of the problem?
> >
> > Thank you veru much for your help,
> >
> > Regards,
> >
> > Amandine
> >
> It seems to me the problem doesn't need 200 lines of code and data to
> describe, it is merely:
> library(mapproj)
> map("france", proj="lambert", pa=c(30, 60))
> map("world", proj="lambert", pa=c(30, 60),  lwd=1, col="red", add=TRUE)
> 
> So I've punted it to the maintainer of mapproj, who isn't me.
> 
> Ray
>



More information about the R-help mailing list