[r-cran-mapproj] 19/23: Import Upstream version 1.2-3

Andreas Tille tille at debian.org
Fri Sep 8 08:03:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository r-cran-mapproj.

commit 5c4c97a0195cbc562fcdf7d36c7435ee5518cdeb
Author: Andreas Tille <tille at debian.org>
Date:   Fri Sep 8 09:58:13 2017 +0200

    Import Upstream version 1.2-3
---
 DESCRIPTION       |  9 +++++----
 MD5               | 12 ++++++------
 NAMESPACE         |  6 +++---
 R/mapproj.r       | 41 +++++++++++++++++++++++------------------
 man/map.grid.Rd   | 37 +++++++++++++++++++------------------
 man/mapproject.Rd | 13 +------------
 src/lambert.c     | 26 ++++++++++++++++++++------
 7 files changed, 77 insertions(+), 67 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index eb3f0dc..6e3819a 100755
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,14 +1,15 @@
 Package: mapproj
 Title: Map Projections
-Version: 1.2-2
-Date: 2014-01-16
+Version: 1.2-3
+Date: 2015-07-08
 Author: Doug McIlroy.  Packaged for R by Ray Brownrigg and Thomas P
         Minka, transition to Plan 9 codebase by Roger Bivand.
 Description: Converts latitude/longitude into projected coordinates.
 Depends: maps (>= 2.3-0)
+Imports: stats, graphics
 License: Lucent Public License
 Maintainer: Ray Brownrigg <Ray.Brownrigg at ecs.vuw.ac.nz>
-Packaged: 2014-01-15 23:10:01 UTC; ray
 NeedsCompilation: yes
+Packaged: 2015-07-08 20:49:58 UTC; ray
 Repository: CRAN
-Date/Publication: 2014-01-16 07:14:39
+Date/Publication: 2015-07-09 14:47:50
diff --git a/MD5 b/MD5
index 2ea0739..8ccceb7 100644
--- a/MD5
+++ b/MD5
@@ -1,9 +1,9 @@
-fcc9147715007d11f8bbd761f9e58fbd *DESCRIPTION
+64d198fa0b45193170c6c593801b30da *DESCRIPTION
 a66243f26e992c2e09d44b07c8617243 *LICENSE.note
-e3ba9ada0c2f29e43945a161a9dbf035 *NAMESPACE
-faae0b105fcc3aa705ecf17bbc7097a7 *R/mapproj.r
-924f5f94fc61488c8cd34478deb3510d *man/map.grid.Rd
-dc388acbb8da028fee91562612b882d6 *man/mapproject.Rd
+9ef1d82ebae14331d0c16e6db465e422 *NAMESPACE
+02ba9c7c2134d825bfc288ac3ea83b56 *R/mapproj.r
+774a5e45c7620829cb08e6b3664d2e02 *man/map.grid.Rd
+1fcc23d01eee11a5bc21a4283ca5a410 *man/mapproject.Rd
 1e220fbd9ec36780a036ddc43a17ef08 *src/Makevars.debug
 963422f3661a1419150ea314b5b3a4c5 *src/aitoff.c
 4cad728b0ed706ee2002f3d977647d27 *src/albers.c
@@ -29,7 +29,7 @@ f5b531d076dc5c1cba56cdafdbd8d90a *src/gilbert.c
 b130df782ad891ab0e13af5c6f5e573e *src/hex.c
 abdfb7e8c7a3d223af25745ea39283d3 *src/homing.c
 3883049518bbc60de9af2394649203ca *src/lagrange.c
-d5cb43e2764ac81e2524041f2d4af2cb *src/lambert.c
+68a3f00baa9ede46c13de50351b3aec5 *src/lambert.c
 270fec0e947e395e1ac74950d4cee39c *src/laue.c
 6073a029d500a0b7c69c2bc6c7eed9bd *src/lune.c
 fa9e51aea2a9c9f2a4b8489e2e4ad052 *src/map.h
diff --git a/NAMESPACE b/NAMESPACE
index 662bca3..7772836 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -1,6 +1,6 @@
 useDynLib("mapproj")
-
-importFrom(maps, map.wrap)
-
+importFrom("maps", "map.wrap", ".map.range")
+importFrom("graphics", "lines", "text")
+importFrom("stats", "median")
 export(map.grid, mapproject, .Last.projection)
 
diff --git a/R/mapproj.r b/R/mapproj.r
index d654b3f..07206f7 100755
--- a/R/mapproj.r
+++ b/R/mapproj.r
@@ -28,7 +28,7 @@ function(x, y, projection = "", parameters = NULL, orientation = NULL)
   else {
     if(nchar(.Last.projection()$projection) == 0) {
       #stop("no previous projection")
-      return(list(x=x,y=y))
+      return(list(x = x, y = y))
     }
     p <- .Last.projection()
     projection <- p$projection
@@ -46,7 +46,7 @@ function(x, y, projection = "", parameters = NULL, orientation = NULL)
               as.double(parameters),
               as.integer(length(parameters)),
               as.double(orientation),
-              error = character(1),PACKAGE="mapproj")$error
+              error = character(1), PACKAGE = "mapproj")$error
   if(error != "")
     stop(error)
   .Last.projection(list(projection = projection,
@@ -58,7 +58,7 @@ function(x, y, projection = "", parameters = NULL, orientation = NULL)
      as.integer(length(x)),
      range = double(4),
      error = integer(1),
-     NAOK = TRUE,PACKAGE="mapproj")[c("x", "y", "range", "error")]
+     NAOK = TRUE, PACKAGE = "mapproj")[c("x", "y", "range", "error")]
 }
 
 map.grid <-
@@ -66,10 +66,10 @@ function(lim, nx = 9, ny = 9, labels = TRUE, pretty = TRUE, cex = 1,
 	col = 4, lty = 2, font = 2, ...) {
   # uses map.wrap from maps package
   pretty.range <-
-  function(lim,...) {
+  function(lim, ...) {
     # like pretty but ensures that the range is identical:
     # range(pretty.range(x)) == range(x)
-    x = pretty(lim,...)
+    x = pretty(lim, ...)
     if(abs(x[1]-lim[1]) > abs(x[2]-lim[1])) x = x[-1]
     n = length(x)
     if(abs(x[n]-lim[2]) > abs(x[n-1]-lim[2])) x = x[-n]
@@ -81,7 +81,7 @@ function(lim, nx = 9, ny = 9, labels = TRUE, pretty = TRUE, cex = 1,
     # use the minimal number of digits to make x's unique
     # similar to abbrev
     for(digits in 0:6) {
-      s = formatC(x,digits=digits,format="f")
+      s = formatC(x, digits = digits, format = "f")
       if(all(duplicated(s) == duplicated(x))) break
     }
     s
@@ -96,26 +96,31 @@ function(lim, nx = 9, ny = 9, labels = TRUE, pretty = TRUE, cex = 1,
     lim[2] <- lim[1] + 360
   }
   if(pretty) {
-    x <- pretty.range(lim[1:2],n=nx)
-    y <- pretty.range(lim[3:4],n=ny)
+    x <- pretty.range(lim[1:2], n = nx)
+    y <- pretty.range(lim[3:4], n = ny)
   } else {
-    x <- seq(lim[1],lim[2],len=nx)
-    y <- seq(lim[3],lim[4],len=ny)
+    x <- seq(lim[1], lim[2], len = nx)
+    y <- seq(lim[3], lim[4], len = ny)
   }
-  p = mapproject(expand.grid(x=c(seq(lim[1],lim[2],len=100),NA),y=y))
+  p = mapproject(expand.grid(x = c(seq(lim[1], lim[2], len = 100), NA),
+  	y = y))
   p = map.wrap(p)
   lines(p,
-        col=col,lty=lty,...)
-  lines(mapproject(expand.grid(y=c(seq(lim[3],lim[4],len=100),NA),x=x)),
-        col=col,lty=lty,...)
+        col = col, lty = lty, ...)
+  lines(mapproject(expand.grid(y = c(seq(lim[3], lim[4],
+ 	len = 100), NA), x = x)), col = col, lty = lty, ...)
   if(labels) {
     tx <- x[2]
     xinc <- median(diff(x))
     ty <- y[length(y)-2]
     yinc <- median(diff(y))
-    text(mapproject(expand.grid(x=x+xinc*0.05,y=ty+yinc*0.5)),
-         labels=auto.format(x),cex=cex,adj=c(0,0),col=col,font=font,...)
-    text(mapproject(expand.grid(x=tx+xinc*0.5,y=y+yinc*0.05)),
-         labels=auto.format(y),cex=cex,adj=c(0,0),col=col,font=font,...)
+    text(mapproject(expand.grid(x = x + xinc*0.05,
+ 	y = ty + yinc*0.5)),
+        labels = auto.format(x), cex = cex, adj = c(0, 0), col = col,
+	font=font, ...)
+    text(mapproject(expand.grid(x = tx + xinc*0.5,
+  	y = y + yinc*0.05)),
+         labels = auto.format(y), cex = cex, adj = c(0, 0), col = col,
+	 font=font, ...)
   }
 }
diff --git a/man/map.grid.Rd b/man/map.grid.Rd
index 10472f8..c0fc483 100755
--- a/man/map.grid.Rd
+++ b/man/map.grid.Rd
@@ -7,7 +7,8 @@
   Draws a grid on an existing map.
 }
 \usage{
-map.grid(lim,nx=9,ny=9,labels=TRUE,pretty=TRUE,cex,col,lty,font,...)
+map.grid(lim, nx=9, ny=9, labels=TRUE, pretty=TRUE, cex, col, lty,
+  font, ...)
 }
 \arguments{
   \item{lim}{a vector of 4 numbers specifying
@@ -15,12 +16,12 @@ map.grid(lim,nx=9,ny=9,labels=TRUE,pretty=TRUE,cex,col,lty,font,...)
     \code{lim} can also be a list with a component named \code{range}, such
     as the result of \code{map}, from which limits are taken.
   }
-  \item{nx,ny}{the desired number of equally-spaced longitude and
+  \item{nx, ny}{the desired number of equally-spaced longitude and
     latitude lines}
   \item{labels}{logical to indicate if grid lines should be labeled with
     longitude/latitude values.}
   \item{pretty}{If \code{TRUE}, grid lines will be placed at round numbers.}
-  \item{cex,col,lty,font}{passed to arguments to \code{par}}
+  \item{cex, col, lty, font}{passed to arguments to \code{par}}
   \item{...}{additional arguments passed to \code{lines} and
     \code{text}, e.g.  \code{col} to change the color of the grid and
     \code{lty} to change the line type.}
@@ -34,31 +35,31 @@ map.grid(lim,nx=9,ny=9,labels=TRUE,pretty=TRUE,cex,col,lty,font,...)
 \seealso{\code{\link[maps]{map}}}
 \examples{
 library(maps)
-m <- map("usa",plot=FALSE)
-map("usa",project="albers",par=c(39,45))
+m <- map("usa", plot=FALSE)
+map("usa", project="albers", par=c(39, 45))
 map.grid(m)
 
 # get unprojected world limits
-m <- map('world',plot=FALSE)
+m <- map('world', plot=FALSE)
 
 # center on NYC
-map('world',proj='azequalarea',orient=c(41,-74,0))
-map.grid(m,col=2)
-points(mapproject(list(y=41,x=-74)),col=3,pch="x",cex=2)
+map('world', proj='azequalarea', orient=c(41, -74, 0))
+map.grid(m, col=2)
+points(mapproject(list(y=41, x=-74)), col=3, pch="x", cex=2)
 
-map('world',proj='orth',orient=c(41,-74,0))
-map.grid(m,col=2,nx=6,ny=5,label=FALSE,lty=2)
-points(mapproject(list(y=41,x=-74)),col=3,pch="x",cex=2)
+map('world', proj='orth', orient=c(41, -74, 0))
+map.grid(m, col=2, nx=6, ny=5, label=FALSE, lty=2)
+points(mapproject(list(y=41, x=-74)), col=3, pch="x", cex=2)
 
 # center on Auckland
-map('world',proj='orth',orient=c(-36.92,174.6,0))
-map.grid(m,col=2,label=FALSE,lty=2)
-points(mapproject(list(y=-36.92,x=174.6)),col=3,pch="x",cex=2)
+map('world', proj='orth', orient=c(-36.92, 174.6, 0))
+map.grid(m, col=2, label=FALSE, lty=2)
+points(mapproject(list(y=-36.92, x=174.6)), col=3, pch="x", cex=2)
 
 m <- map('nz')
 # center on Auckland
-map('nz',proj='azequalarea',orient=c(-36.92,174.6,0))
-points(mapproject(list(y=-36.92,x=174.6)),col=3,pch="x",cex=2)
-map.grid(m,col=2)
+map('nz', proj='azequalarea', orient=c(-36.92, 174.6, 0))
+points(mapproject(list(y=-36.92, x=174.6)), col=3, pch="x", cex=2)
+map.grid(m, col=2)
 }
 \keyword{aplot}
diff --git a/man/mapproject.Rd b/man/mapproject.Rd
index 9291ff2..0d8300e 100755
--- a/man/mapproject.Rd
+++ b/man/mapproject.Rd
@@ -87,8 +87,7 @@ the standard form appropriate to the overlay, but presenting
 information from the underlying globe.
 
 
-In the descriptions that follow (adapted from the McIlroy
-reference), each projection is shown as a
+In the descriptions that follow each projection is shown as a
 function call; if it requires parameters, these are shown as
 arguments to the function.
 The descriptions are grouped into families.
@@ -206,9 +205,6 @@ not make sense for tilted orientations.
 }
 } % end details
 \references{
-  Tom Minka, An overview of map projections.
-  \url{http://www.stat.cmu.edu/~minka/courses/36-315/handout/handout17.pdf}
-  
   Richard A. Becker, and Allan R. Wilks,
   "Maps in S",
   \emph{AT\&T Bell Laboratories Statistics Research Report, 1991.}
@@ -218,13 +214,6 @@ not make sense for tilted orientations.
   Documentation from the
   \emph{Tenth Edition UNIX Manual, Volume 1,}
   Saunders College Publishing, 1990.
-
-  M. D. McIlroy,  Source code for maps and map projections, included in 
-the Plan 9 distribution at: \url{http://plan9.bell-labs.com/plan9/download.html}
-(sys/src/cmd/map/), downloaded November 1, 2009 by Roger Bivand.
-  %\url{http://plan9.bell-labs.com/plan9/download.html}
-  %\url{http://www.cs.dartmouth.edu/~doug/source.html}
-  %\url{http://cm.bell-labs.com/cs/who/doug/map.tar.gz}
 }
 \examples{
 library(maps)
diff --git a/src/lambert.c b/src/lambert.c
old mode 100755
new mode 100644
index 4c234f4..4fbd31c
--- a/src/lambert.c
+++ b/src/lambert.c
@@ -1,5 +1,10 @@
-/* RSB #include <u.h>
-#include <libc.h>*/
+/************************************************************
+
+Copyright (C) 1998, Lucent Technologies
+All rights reserved
+
+************************************************************/
+
 #include "map.h"
 
 static struct coord stdp0, stdp1;
@@ -36,11 +41,20 @@ lambert(double par0, double par1)
 	deg2rad(par1, &stdp1);
 	if(fabs(par1+par0)<.1) 
 		return(mercator());
+	if(fabs(par1)>89.5) {
+		if(par0>89.5)
+			return(map_perspective(-1.));
+		else if(par0<-89.5)
+			return 0;	/* S pole stereographic */
+		else
+			return 0;
+	}
 	if(fabs(par1-par0)<.1)
-		return(map_perspective(-1.));
-	if(fabs(par0)>89.5||fabs(par1)>89.5)
-		return(0);
-	k = 2*log(stdp1.c/stdp0.c)/log(
+	  /* series expansion about stdp1.s = stdp0.s */
+	  /* thanks to Alex Deckmyn for pointing this out */
+	  k = stdp0.s + 0.5*(stdp1.s - stdp0.s);
+	else 
+	  k = 2*log(stdp1.c/stdp0.c)/log(
 		(1+stdp0.s)*(1-stdp1.s)/((1-stdp0.s)*(1+stdp1.s)));
 	return(Xlambert);
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/r-cran-mapproj.git



More information about the debian-science-commits mailing list