[r-cran-maptools] 03/20: Import Upstream version 0.7.26

Andreas Tille tille at debian.org
Sun Jan 15 18:55:43 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-maptools.

commit a34d1d5dfa107ba77e7810de124302095b8e2bdd
Author: Andreas Tille <tille at debian.org>
Date:   Sun Jan 15 19:53:25 2017 +0100

    Import Upstream version 0.7.26
---
 ChangeLog                   | 56 +++++++++++++++++++++++++++++--
 DESCRIPTION                 | 22 ++++++++++---
 LICENSE                     | 16 +++++----
 R/SpatialLines-methods.R    |  2 +-
 R/SpatialPolys-methods.R    | 14 +++++---
 R/readSplus.R               |  8 +++++
 R/sp_spat1.R                |  4 +++
 R/spatstat1.R               | 80 ++++++++++++++++++++++++++++++++++-----------
 inst/ChangeLog              | 56 +++++++++++++++++++++++++++++--
 inst/LICENSE                |  6 +---
 man/GE_SpatialGrid.Rd       |  4 ++-
 man/Map2poly.Rd             |  2 +-
 man/SpatialLines2PolySet.Rd |  2 +-
 man/as.ppp.Rd               | 20 +++++++++---
 man/asciigrid.Rd            |  2 +-
 man/kmlLine.Rd              |  4 ++-
 man/kmlOverlay.Rd           |  3 +-
 man/kmlPolygon.Rd           |  2 ++
 man/nowrapRecenter.Rd       |  2 +-
 19 files changed, 250 insertions(+), 55 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ae93186..9882e7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,60 @@
+2009-09-17 10:22  rsbivand
+
+	* DESCRIPTION, man/GE_SpatialGrid.Rd, man/Map2poly.Rd,
+	  man/SpatialLines2PolySet.Rd, man/asciigrid.Rd, man/kmlLine.Rd,
+	  man/kmlOverlay.Rd, man/nowrapRecenter.Rd: fix documentation links
+
+2009-07-14 11:17  rsbivand
+
+	* man/: GE_SpatialGrid.Rd, kmlLine.Rd, kmlOverlay.Rd,
+	  kmlPolygon.Rd: KML WGS84 notes added
+
+2009-06-22 16:52  rsbivand
+
+	* ChangeLog, DESCRIPTION, R/SpatialPolys-methods.R, inst/ChangeLog:
+	  changed all.equal to identical in closed ring forcing
+
+2009-06-10 16:33  rsbivand
+
+	* ChangeLog, DESCRIPTION, R/SpatialPolys-methods.R, inst/ChangeLog:
+	  more NULL geometry trapping
+
+2009-05-26 12:22  rsbivand
+
+	* ChangeLog, DESCRIPTION, R/sp_spat1.R, R/spatstat1.R,
+	  inst/ChangeLog, man/as.ppp.Rd: coercion from owin/tess to
+	  SpatialPolygons
+
+2009-04-08 19:29  rsbivand
+
+	* ChangeLog, DESCRIPTION, R/spatstat1.R, inst/ChangeLog:
+	  improvements to spatstat support - Adrian Baddeley
+
+2009-03-29 17:32  rsbivand
+
+	* ChangeLog, DESCRIPTION, inst/ChangeLog: drop=FALSE in reading
+	  line and polygon shapefiles
+
+2009-03-29 17:29  rsbivand
+
+	* LICENSE, R/SpatialLines-methods.R, R/SpatialPolys-methods.R,
+	  inst/LICENSE: drop=FALSE in reading line and polygon shapefiles
+
+2009-03-17 21:43  vir
+
+	* R/readSplus.R: Minor fix to allow for a line with NA's just
+	  before the END.
+
+2009-03-10 18:23  rsbivand
+
+	* INDEX, LICENSE, inst/LICENSE, ChangeLog, inst/ChangeLog: data web
+	  link
+
 2009-02-18 12:58  rsbivand
 
 	* inst/shapes/fylk-val-ll.dbf, inst/shapes/fylk-val-ll.shp,
-	  inst/shapes/fylk-val-ll.shx, data/wrld_simpl.rda: kml writing;
-	  GSHHS lines shift
+	  inst/shapes/fylk-val-ll.shx, data/wrld_simpl.rda, ChangeLog,
+	  inst/ChangeLog: kml writing; GSHHS lines shift
 
 2009-02-18 12:55  rsbivand
 
diff --git a/DESCRIPTION b/DESCRIPTION
index e3093b4..12c9b06 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,12 +1,24 @@
 Package: maptools
-Version: 0.7-20
-Date: 2009-02-18
+Version: 0.7-26
+Date: 2009-09-17
 Title: Tools for reading and handling spatial objects
 Encoding: latin1
-Author: Nicholas J. Lewin-Koh and Roger Bivand, contributions by Edzer J. Pebesma, Eric Archer, Adrian Baddeley, Hans-Jörg Bibiko, Stéphane Dray, David Forrest, Patrick Giraudoux, Duncan Golicher, Virgilio Gómez Rubio, Patrick Hausmann, Thomas Jagger, Sebastian P. Luque, Don MacQueen, Andrew Niccolai and Tom Short
+Author: Nicholas J. Lewin-Koh and Roger Bivand, contributions by Edzer
+        J. Pebesma, Eric Archer, Adrian Baddeley, Hans-Jörg Bibiko,
+        Stéphane Dray, David Forrest, Patrick Giraudoux, Duncan
+        Golicher, Virgilio Gómez Rubio, Patrick Hausmann, Thomas
+        Jagger, Sebastian P. Luque, Don MacQueen, Andrew Niccolai and
+        Tom Short
 Maintainer: Roger Bivand <Roger.Bivand at nhh.no>
 Depends: R (>= 2.4), foreign (>= 0.8), sp (>= 0.9-7), methods
 Suggests: spatstat, PBSmapping, maps, gpclib, RArcInfo
-Description: Set of tools for manipulating and reading geographic data, in particular ESRI shapefiles; C code used from shapelib. It includes binary access to GSHHS shoreline files. The package also provides interface wrappers for exchanging spatial objects with packages such as PBSmapping, spatstat, maps, RArcInfo, Stata tmap, WinBUGS, Mondrian, and others.
+Description: Set of tools for manipulating and reading geographic data,
+        in particular ESRI shapefiles; C code used from shapelib. It
+        includes binary access to GSHHS shoreline files. The package
+        also provides interface wrappers for exchanging spatial objects
+        with packages such as PBSmapping, spatstat, maps, RArcInfo,
+        Stata tmap, WinBUGS, Mondrian, and others.
 License: GPL (>= 2)
-Packaged: Wed Feb 18 13:02:58 2009; rsb
+Packaged: 2009-09-17 08:31:29 UTC; rsb
+Repository: CRAN
+Date/Publication: 2009-09-18 20:25:13
diff --git a/LICENSE b/LICENSE
index da74fb6..b8ff71a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -35,10 +35,6 @@ Further details of Shapelib may be found at its website
 
 http://shapelib.maptools.org/
 
-It is the intention of the package maintainer to migrate to linking 
-against an external shapelib, rather than incoroprating complete files 
-unchanged in this package.
-
 Files: src/Rcentroid.c, src/Rshapeinfo.c, src/maptools.h, and
 src/Rshapeget.c are copyright (c) 2000-2001 by Nicholas Lewin-Koh and are
 subject to the licence at the foot of this file. Some portions of these
@@ -50,14 +46,14 @@ Files: inst/shapes/baltim.*, inst/shapes/columbus.*, and inst/shapes/sids.*
 are derived by permission from SAL data files
 prepared by Luc Anselin; they were downloaded from:
 
-http://sal.agecon.uiuc.edu/stuff/data.html
+http://geodacenter.asu.edu/sdata
 
 under the following conditions: "The data are provided as is, without 
 any warranties. Please make sure to give proper credit when using 
 them in any publications. Some of the data sets are purely illustrative 
 and should not be used for substantive research."
 
-Files: inst/shapes/fylk-val.* are copyright Statens Kartverk 2001, and
+Files: inst/shapes/fylk-val* are copyright Statens Kartverk 2001, and
 were released (with a collection of other shapefiles) to the public domain
 in July 2001. The link to the relevant page under http://www.statkart.no
 has now expired, this copy downloaded 13 July 2001.
@@ -66,6 +62,14 @@ Files: inst/shapes/pointZ.* are a sample of points from a 3D point shapefile
 kindly contributed by Michael Toews to be used here for illustrative purposes;
 this sample is written out using writePointsShape(). 
 
+File: data/wrld_simpl.rda is a modified SpatialPolygonsDataFrame object
+generated from the TM_WORLD_BORDERS_SIMPL-0.2 shapefile downloaded from
+http://mappinghacks.com/data/TM_WORLD_BORDERS_SIMPL-0.2.zip with the 
+attribution: "The world_borders.zip dataset has been superseded by Bjørn 
+Sandvik's improved version, TM_WORLD_BORDERS-0.2.zip, mirrored from 
+thematicmapping.org." The country Polygons objects and the data slot data 
+frame row numbers have been set to the ISO 3166 three letter codes.
+
 All other files are copyright (c) 2001-2004 Roger S. Bivand and Nicholas
 Lewin-Koh, and are subject to the licence at the foot of this file.
 
diff --git a/R/SpatialLines-methods.R b/R/SpatialLines-methods.R
index 6c5b765..607e1b0 100644
--- a/R/SpatialLines-methods.R
+++ b/R/SpatialLines-methods.R
@@ -51,7 +51,7 @@ writeLinesShape <- function(x, fn, factor2char = TRUE, max_nchar=254) {
 	}
 	res <- vector(mode="list", length=nParts)
 	for (i in 1:nParts) {
-		res[[i]] <- Line(coords=shape$verts[from[i]:to[i],])
+		res[[i]] <- Line(coords=shape$verts[from[i]:to[i],,drop=FALSE])
 	}
 	Lines <- Lines(res, ID=ID)
 	Lines
diff --git a/R/SpatialPolys-methods.R b/R/SpatialPolys-methods.R
index 5190b02..e1b5e04 100644
--- a/R/SpatialPolys-methods.R
+++ b/R/SpatialPolys-methods.R
@@ -26,8 +26,10 @@ writePolyShape <- function(x, fn, factor2char = TRUE, max_nchar=254) {
 .Map2PolyDF <- function(Map, IDs, proj4string=CRS(as.character(NA)),
 	force_ring=FALSE, delete_null_obj=FALSE, retrieve_ABS_null=FALSE) {
 # ABS null part shapefiles Graham Williams 080403
+# birds NULL part Allen H. Hurlbert 090610
+        nullParts <- sapply(Map$Shapes, function(x) x$nParts) == 0
         if (delete_null_obj) {
-	    nullParts <- which(sapply(Map$Shapes, function(x) x$nParts) == 0)
+	    nullParts <- which(nullParts)
 	    if (length(nullParts) > 0) {
               if (!retrieve_ABS_null) {
 		for (i in length(nullParts):1)
@@ -42,7 +44,11 @@ writePolyShape <- function(x, fn, factor2char = TRUE, max_nchar=254) {
                 return(res)
               }
             }
-        }
+        } else {
+# birds NULL part Allen H. Hurlbert 090610
+            if (any(nullParts))
+               stop(paste("NULL geometry found:", paste(which(nullParts), collapse=", "), "\n               consider using delete_null_obj=TRUE"))
+	}
 	if (is.null(IDs))
 		IDs <- as.character(sapply(Map$Shapes, function(x) x$shpID))
 	SR <- .asSpatialPolygonsShapes(Map$Shapes, IDs, 
@@ -151,9 +157,9 @@ writePolyShape <- function(x, fn, factor2char = TRUE, max_nchar=254) {
 	}
 	srl <- vector(mode="list", length=nParts)
 	for (j in 1:nParts) {
-		crds <- shp$verts[from[j]:to[j],]
+		crds <- shp$verts[from[j]:to[j],,drop=FALSE]
 		if (force_ring) {
-			if (!isTRUE(all.equal(crds[1,], crds[nrow(crds),])))
+			if (!isTRUE(identical(crds[1,], crds[nrow(crds),])))
 				crds <- rbind(crds, crds[1,])
 		}
 		srl[[j]] <- Polygon(coords=crds)
diff --git a/R/readSplus.R b/R/readSplus.R
index c8bde57..c6cd02a 100644
--- a/R/readSplus.R
+++ b/R/readSplus.R
@@ -57,8 +57,16 @@ readSplus<-function(file, proj4string=CRS(as.character(NA)) )
 	lpolys<-.NAmat2xyList(polys2)
 #	llpolys<-unlist(lapply(lpolys, nrow))
 
+	#OpenBUGS seems to put a line with NAs just before the END
+	#We need to remove it
+	if(is.na(polys[nrow(polys),1]))
+		polys<-polys[-nrow(polys),]
+		
+
 #	idx<- c(1, cumsum(2+llpolys[-length(lpolys)]))
         wNA <- which(is.na(polys[, 1]))
+
+
         idx <- c(1, wNA+1)
 	polysIDs<-polys[idx, 1]
 
diff --git a/R/sp_spat1.R b/R/sp_spat1.R
index 2bfc829..80a7abd 100644
--- a/R/sp_spat1.R
+++ b/R/sp_spat1.R
@@ -11,6 +11,10 @@ if (!isClass("owin"))
 if (!isClass("im"))
     setClass("im")
 
+if (!isClass("tess"))
+    setClass("tess")
+
+
 as.SpatialPoints.ppp =  function(from) {
     mult <- 1
     if (!is.null(from$window$units) && !is.null(from$window$units$multiplier))
diff --git a/R/spatstat1.R b/R/spatstat1.R
index 656009f..cc0b4d6 100644
--- a/R/spatstat1.R
+++ b/R/spatstat1.R
@@ -6,19 +6,22 @@ as.ppp.SpatialPoints = function(X) {
         colnames(bb) <- NULL
 	W = owin(bb[1,], bb[2,])
 	cc = coordinates(X)
-	return(ppp(cc[,1], cc[,2], window = W, marks = NULL))
+	return(ppp(cc[,1], cc[,2], window = W, marks = NULL, check=FALSE))
 }
 
 setAs("SpatialPoints", "ppp", function(from) as.ppp.SpatialPoints(from))
 
 as.ppp.SpatialPointsDataFrame = function(X) {
 	require(spatstat)
-	W = owin(bbox(X)[1,], bbox(X)[2,])
-	if (ncol(X) > 1)
-	  stop("ppp objects only accept a single attribute column; please select one")
-	marks = X[[1]]
-	cc = coordinates(X)
-	return(ppp(cc[,1], cc[,2], window = W, marks = marks))
+	bb <- bbox(X)
+        colnames(bb) <- NULL
+	W  <- owin(bb[1,], bb[2,])
+	nc <- ncol(X)
+        marks <- if(nc == 0) NULL else X[[1]]
+        if(nc > 1)
+          warning(paste(nc-1, "columns of data frame discarded"))
+	cc <- coordinates(X)
+	return(ppp(cc[,1], cc[,2], window = W, marks = marks, check=FALSE))
 }
 
 setAs("SpatialPointsDataFrame", "ppp", function(from) as.ppp.SpatialPointsDataFrame(from))
@@ -52,16 +55,55 @@ as.owin.SpatialPolygons = function(W, ..., fatal) {
 
 setAs("SpatialPolygons", "owin", function(from) as.owin.SpatialPolygons(from))
 
-# methods for 'as.psp' for sp classes
+# methods for coercion to Spatial Polygons by Adrian Baddeley
+
+owin2Polygons <- function(x, id="1") {
+  stopifnot(is.owin(x))
+  x <- as.polygonal(x)
+  closering <- function(df) { df[c(seq(nrow(df)), 1), ] }
+  pieces <- lapply(x$bdry,
+                   function(p) {
+                     Polygon(coords=closering(cbind(p$x,p$y)),
+                             hole=is.hole.xypolygon(p))  })
+  z <- Polygons(pieces, id)
+  return(z)
+}
+
+as.SpatialPolygons.tess <- function(x) {
+  stopifnot(is.tess(x))
+  y <- tiles(x)
+  nam <- names(y)
+  z <- list()
+  for(i in seq(y))
+    z[[i]] <- owin2Polygons(y[[i]], nam[i])
+  return(SpatialPolygons(z))
+}
+
+setAs("tess", "SpatialPolygons", function(from) as.SpatialPolygons.tess(from))
+
+
+as.SpatialPolygons.owin <- function(x) {
+  stopifnot(is.owin(x))
+  y <- owin2Polygons(x)
+  z <- SpatialPolygons(list(y))
+  return(z)
+}
+
+setAs("owin", "SpatialPolygons", function(from) as.SpatialPolygons.owin(from))
+
+
+
+# methods for 'as.psp' for sp classes by Adrian Baddeley
 
 as.psp.Line <- function(from, ..., window=NULL, marks=NULL, fatal) {
   xy <- from at coords
-  xrange <- range(xy[,1])
-  yrange <- range(xy[,2])
   df <- as.data.frame(cbind(xy[-nrow(xy), , drop=FALSE], xy[-1, ,
 drop=FALSE]))
-  if(is.null(window))
+  if(is.null(window)) {
+    xrange <- range(xy[,1])
+    yrange <- range(xy[,2])
     window <- owin(xrange, yrange)
+  }
   return(as.psp(df, window=window, marks=marks))
 }
 
@@ -78,16 +120,16 @@ as.psp.Lines <- function(from, ..., window=NULL, marks=NULL, fatal) {
 setAs("Lines", "psp", function(from) as.psp.Lines(from))
 
 as.psp.SpatialLines <- function(from, ..., window=NULL, marks=NULL, fatal) {
+  if(is.null(window)) {
+    w <- from at bbox
+    window <- owin(w[1,], w[2,])
+  }
   lin <- from at lines
-  y <- lapply(lin, as.psp.Lines)
+  y <- lapply(lin, as.psp.Lines, window=window)
   id <- unlist(lapply(lin, function(s) { s at ID }))
   if(is.null(marks))
     for(i in seq(y)) 
       marks(y[[i]]) <- id[i]
-  if(is.null(window)) {
-    w <- from at bbox
-    window <- owin(w[1,], w[2,])
-  }
   z <- do.call("superimposePSP", list(y, window=window))
   if(!is.null(marks))
     marks(z) <- marks
@@ -102,13 +144,13 @@ as.psp.SpatialLinesDataFrame <- function(from, ..., window=NULL, marks=NULL, fat
   if(is.null(marks)) {
     # extract marks from first column of data frame
     df <- from at data
-    if(is.null(df))
+    if(is.null(df) || (nc <- ncol(df)) == 0)
       return(z)
-    if((nc <- ncol(df)) > 1) 
+    if(nc > 1) 
       warning(paste(nc-1, "columns of data frame discarded"))
     marx <- df[,1]
     nseg.Line  <- function(x) { return(nrow(x at coords)-1) }
-    nseg.Lines <- function(x) { return(unlist(lapply(x at Lines, nseg.Line))) }
+    nseg.Lines <- function(x) { return(sum(unlist(lapply(x at Lines, nseg.Line)))) }
     nrep <- unlist(lapply(y at lines, nseg.Lines))
     marks(z) <- rep(marx, nrep)
   }
diff --git a/inst/ChangeLog b/inst/ChangeLog
index ae93186..9882e7d 100644
--- a/inst/ChangeLog
+++ b/inst/ChangeLog
@@ -1,8 +1,60 @@
+2009-09-17 10:22  rsbivand
+
+	* DESCRIPTION, man/GE_SpatialGrid.Rd, man/Map2poly.Rd,
+	  man/SpatialLines2PolySet.Rd, man/asciigrid.Rd, man/kmlLine.Rd,
+	  man/kmlOverlay.Rd, man/nowrapRecenter.Rd: fix documentation links
+
+2009-07-14 11:17  rsbivand
+
+	* man/: GE_SpatialGrid.Rd, kmlLine.Rd, kmlOverlay.Rd,
+	  kmlPolygon.Rd: KML WGS84 notes added
+
+2009-06-22 16:52  rsbivand
+
+	* ChangeLog, DESCRIPTION, R/SpatialPolys-methods.R, inst/ChangeLog:
+	  changed all.equal to identical in closed ring forcing
+
+2009-06-10 16:33  rsbivand
+
+	* ChangeLog, DESCRIPTION, R/SpatialPolys-methods.R, inst/ChangeLog:
+	  more NULL geometry trapping
+
+2009-05-26 12:22  rsbivand
+
+	* ChangeLog, DESCRIPTION, R/sp_spat1.R, R/spatstat1.R,
+	  inst/ChangeLog, man/as.ppp.Rd: coercion from owin/tess to
+	  SpatialPolygons
+
+2009-04-08 19:29  rsbivand
+
+	* ChangeLog, DESCRIPTION, R/spatstat1.R, inst/ChangeLog:
+	  improvements to spatstat support - Adrian Baddeley
+
+2009-03-29 17:32  rsbivand
+
+	* ChangeLog, DESCRIPTION, inst/ChangeLog: drop=FALSE in reading
+	  line and polygon shapefiles
+
+2009-03-29 17:29  rsbivand
+
+	* LICENSE, R/SpatialLines-methods.R, R/SpatialPolys-methods.R,
+	  inst/LICENSE: drop=FALSE in reading line and polygon shapefiles
+
+2009-03-17 21:43  vir
+
+	* R/readSplus.R: Minor fix to allow for a line with NA's just
+	  before the END.
+
+2009-03-10 18:23  rsbivand
+
+	* INDEX, LICENSE, inst/LICENSE, ChangeLog, inst/ChangeLog: data web
+	  link
+
 2009-02-18 12:58  rsbivand
 
 	* inst/shapes/fylk-val-ll.dbf, inst/shapes/fylk-val-ll.shp,
-	  inst/shapes/fylk-val-ll.shx, data/wrld_simpl.rda: kml writing;
-	  GSHHS lines shift
+	  inst/shapes/fylk-val-ll.shx, data/wrld_simpl.rda, ChangeLog,
+	  inst/ChangeLog: kml writing; GSHHS lines shift
 
 2009-02-18 12:55  rsbivand
 
diff --git a/inst/LICENSE b/inst/LICENSE
index 8b59b4a..b8ff71a 100644
--- a/inst/LICENSE
+++ b/inst/LICENSE
@@ -35,10 +35,6 @@ Further details of Shapelib may be found at its website
 
 http://shapelib.maptools.org/
 
-It is the intention of the package maintainer to migrate to linking 
-against an external shapelib, rather than incoroprating complete files 
-unchanged in this package.
-
 Files: src/Rcentroid.c, src/Rshapeinfo.c, src/maptools.h, and
 src/Rshapeget.c are copyright (c) 2000-2001 by Nicholas Lewin-Koh and are
 subject to the licence at the foot of this file. Some portions of these
@@ -50,7 +46,7 @@ Files: inst/shapes/baltim.*, inst/shapes/columbus.*, and inst/shapes/sids.*
 are derived by permission from SAL data files
 prepared by Luc Anselin; they were downloaded from:
 
-http://sal.agecon.uiuc.edu/stuff/data.html
+http://geodacenter.asu.edu/sdata
 
 under the following conditions: "The data are provided as is, without 
 any warranties. Please make sure to give proper credit when using 
diff --git a/man/GE_SpatialGrid.Rd b/man/GE_SpatialGrid.Rd
index 075186c..cc3d673 100644
--- a/man/GE_SpatialGrid.Rd
+++ b/man/GE_SpatialGrid.Rd
@@ -22,9 +22,11 @@ Sobj_SpatialGrid(obj, asp=1, maxDim=100, n=NULL)
   The function is used together with \code{kmlOverlay} to wrap around the opening of a PNG graphics device, plotting code, and the closing of the device. The computed values take account of the adjustment of the actual data bounding box to an integer number of rows and columns in the image file. 
 
 The approach may be used as an alternative to writing PNG files from SpatialGrid and SpatialPixel objects in \pkg{rgdal} using \code{writeGDAL}, and to writing KML files using \code{writeOGR} for vector data objects. The output PNG files are likely to be very much smaller than large vector data KML files, and hinder the retrieval of exact positional information.
+
+Note that the geometries should be in geographical coordinates with datum WGS84 for export to KML.
 }
 \value{
-  returns an S3 object of class \code{\dQuote{GE_SG}} with components:
+  returns an S3 object of class \code{GE_SG} with components:
   \item{height}{Integer raster height for png call}
   \item{width}{Integer raster width for png call}
   \item{SG}{a SpatialGrid object with the grid topology of the output PNG}
diff --git a/man/Map2poly.Rd b/man/Map2poly.Rd
index af16940..8d4289e 100644
--- a/man/Map2poly.Rd
+++ b/man/Map2poly.Rd
@@ -65,7 +65,7 @@ convert.pl(pl)
 
 \author{Roger Bivand and St�phane Dray, \email{Roger.Bivand at nhh.no}}
  
-\seealso{\code{\link{read.shape}}, \code{\link[shapefiles]{read.shapefile}}}
+\seealso{\code{\link{read.shape}}, \code{\link[shapefiles]{shapefiles}}}
 
 
 \examples{
diff --git a/man/SpatialLines2PolySet.Rd b/man/SpatialLines2PolySet.Rd
index b3c462d..41741fd 100644
--- a/man/SpatialLines2PolySet.Rd
+++ b/man/SpatialLines2PolySet.Rd
@@ -29,7 +29,7 @@ PolySet2SpatialPolygons(PS, close_polys=TRUE)
 \author{Roger Bivand and Andrew Niccolai}
 
 
-\seealso{\code{\link[PBSmapping]{as.PolySet}}, \code{\link{MapGen2SL}}}
+\seealso{\code{\link[PBSmapping]{PolySet}}, \code{\link{MapGen2SL}}}
 
 \examples{
 library(PBSmapping)
diff --git a/man/as.ppp.Rd b/man/as.ppp.Rd
index 4b7e239..f3f565e 100644
--- a/man/as.ppp.Rd
+++ b/man/as.ppp.Rd
@@ -6,6 +6,10 @@
 \alias{coerce,SpatialGridDataFrame,owin-method}
 \alias{coerce,SpatialPixelsDataFrame,owin-method}
 \alias{coerce,SpatialPolygons,owin-method}
+\alias{as.SpatialPolygons.tess}
+\alias{as.SpatialPolygons.owin}
+\alias{coerce,tess,SpatialPolygons-method}
+\alias{coerce,owin,SpatialPolygons-method}
 \alias{coerce,SpatialGridDataFrame,im-method}
 \alias{as.ppp.SpatialGridDataFrame}
 \alias{as.ppp.SpatialPoints}
@@ -31,7 +35,7 @@
 
 \title{coercion between sp objects and spatstat objects}
 \description{
-S4-style as() coercion works from objects of S4 sp classes to spatstat S3 classes, but not the reverse. Coercion to sp classes uses direct function calls.
+S4-style as() coercion works between objects of S4 sp classes to spatstat S3 classes; direct function calls may also be used.
 }
 \section{Methods}{
   \describe{
@@ -50,6 +54,8 @@ S4-style as() coercion works from objects of S4 sp classes to spatstat S3 classe
 \item{coerce}{\code{signature(from = "ppp", to = "SpatialGridDataFrame")}}
 \item{coerce}{\code{signature(from = "ppp", to = "SpatialPointsDataFrame")}}
 \item{coerce}{\code{signature(from = "ppp", to = "SpatialPoints")}}
+\item{coerce}{\code{signature(from = "owin", to = "SpatialPolygons")}}
+\item{coerce}{\code{signature(from = "tess", to = "SpatialPolygons")}}
 }
 }
 
@@ -62,9 +68,11 @@ as.psp.Line(from, ..., window=NULL, marks=NULL, fatal)
 as.psp.Lines(from, ..., window=NULL, marks=NULL, fatal)
 as.psp.SpatialLines(from, ..., window=NULL, marks=NULL, fatal)
 as.psp.SpatialLinesDataFrame(from, ..., window=NULL, marks=NULL, fatal)
+as.SpatialPolygons.tess(x)
+as.SpatialPolygons.owin(x)
 }
 \arguments{
-  \item{from}{object to coerce from}
+  \item{from, x}{object to coerce from}
   \item{...}{other arguments to be passed through}
   \item{window}{window as defined in the spatstat package}
   \item{marks}{marks as defined in the spatstat package}
@@ -101,8 +109,6 @@ mr <- Line(meuse.riv)
 mr_psp <- as(mr, "psp")
 mr_psp
 plot(mr_psp)
-# as.owin(meuse.grid)
-# --- will only work if as.owin is method...
 mg_owin <- as(as(meuse.grid["ffreq"], "SpatialPixelsDataFrame"), "owin")
 mg_owin
 ho_sp <- SpatialPolygons(list(Polygons(list(Polygon(cbind(c(0,1,1,0,0),
@@ -116,6 +122,12 @@ plot(pp)
 ho_orig <- owin(poly=list(list(x=c(0,1,1,0), y=c(0,0,1,1)),
   list(x=c(0.6,0.4,0.4,0.6), y=c(0.2,0.2,0.4,0.4))))
 identical(ho, ho_orig)
+ho_sp1 <- as(ho, "SpatialPolygons")
+all.equal(ho_sp, ho_sp1, check.attributes=FALSE)
+A <- tess(xgrid=0:4,ygrid=0:4)
+A_sp <- as(A, "SpatialPolygons")
+plot(A_sp)
+text(coordinates(A_sp), sapply(slot(A_sp, "polygons"), slot, "ID"), cex=0.6)
 mg_dist <- meuse.grid["dist"]
 fullgrid(mg_dist) <- TRUE
 image(mg_dist, axes=TRUE)
diff --git a/man/asciigrid.Rd b/man/asciigrid.Rd
index 486a387..a8283f2 100644
--- a/man/asciigrid.Rd
+++ b/man/asciigrid.Rd
@@ -33,7 +33,7 @@ to write the numeric data }
 	as.image is TRUE, as list with components \code{x}, \code{y} and \code{z}.
 }
 \note{In ArcGIS 8, it was not in general necessary to set the \code{dec} argument; it is not necessary in a mixed environment with ArcView 3.2 (R writes and ArcView reads "."), but inter-operation with ArcGIS 9 requires care because the defaults used by ArcGIS seem to be misleading, and it may be necessary to override what appear to be platform defaults by setting the argument.}
-\seealso{ \link[sp]{as.image.SpatialGridDataFrame}, \link[graphics]{image} }
+\seealso{ \code{\link[sp]{image}}, \code{\link[graphics]{image}} }
 \author{Edzer J.\ Pebesma, e.pebesma at geo.uu.nl}
 \examples{
 x <- readAsciiGrid(system.file("grids/test.ag", package="maptools")[1])
diff --git a/man/kmlLine.Rd b/man/kmlLine.Rd
index c45d402..56b3998 100644
--- a/man/kmlLine.Rd
+++ b/man/kmlLine.Rd
@@ -32,6 +32,8 @@ y <- kmlLine(kmlname="", kmldescription="")
 
 For a passed \code{Lines} object the function generates a <Style> tag whereby its id attribute is set to the passed object's ID.
 
+Note that the geometries should be in geographical coordinates with datum WGS84.
+
 The resulting KML line will be embedded in \code{<Placemark><MultiGeometry><LineString>}.
 }
 
@@ -46,7 +48,7 @@ The following color specifications are allowed: \code{'red'}, \code{2}, or as he
 }
 
 \author{Hans-J. Bibiko}
-\seealso{\code{\link{kmlOverlay}}, \code{\link{kmlPolygon}}, \code{\link[sp]{Lines}}}
+\seealso{\code{\link{kmlOverlay}}, \code{\link{kmlPolygon}}, \code{\link[sp]{Line}}}
 
 \examples{
 xx <- readShapeSpatial(system.file("shapes/fylk-val-ll.shp",
diff --git a/man/kmlOverlay.Rd b/man/kmlOverlay.Rd
index 0c5ffa7..2682847 100644
--- a/man/kmlOverlay.Rd
+++ b/man/kmlOverlay.Rd
@@ -10,7 +10,7 @@ kmlOverlay(obj, kmlfile = NULL, imagefile = NULL, name = "R image")
 }
 %- maybe also 'usage' for other objects documented here.
 \arguments{
-  \item{obj}{a \code{\dQuote{GE_SG}} object from \code{GE_SpatialGrid}}
+  \item{obj}{a \code{GE_SG} object from \code{GE_SpatialGrid}}
   \item{kmlfile}{if not NULL the name of the kml file to be written}
   \item{imagefile}{the name of the PNG file containing the image - this should be either relative (same directory as kml file) or abosolute (fully qualified)}
   \item{name}{the name used to describe the image overlay in GE}
@@ -20,6 +20,7 @@ kmlOverlay(obj, kmlfile = NULL, imagefile = NULL, name = "R image")
 
 The approach may be used as an alternative to writing PNG files from SpatialGrid and SpatialPixel objects in \pkg{rgdal} using \code{writeGDAL}, and to writing KML files using \code{writeOGR} for vector data objects. The output PNG files are likely to be very much smaller than large vector data KML files, and hinder the retrieval of exact positional information.
 
+Note that the geometries should be in geographical coordinates with datum WGS84.
 }
 \value{
 x is a character vector containing the generated lines of the kml file
diff --git a/man/kmlPolygon.Rd b/man/kmlPolygon.Rd
index 077a3f6..c1400f4 100755
--- a/man/kmlPolygon.Rd
+++ b/man/kmlPolygon.Rd
@@ -37,6 +37,8 @@ The conversion can also handle polygons which are marked as holes inside of the
 
 For a passed \code{Polygons} object the function generates a <Style> tag whereby its id attribute is set to the passed object's ID.
 
+Note that the geometries should be in geographical coordinates with datum WGS84.
+
 The resulting KML polygon will be embedded in \code{<Placemark><MultiGeometry><Polygon>}.
 }
 
diff --git a/man/nowrapRecenter.Rd b/man/nowrapRecenter.Rd
index 67ef220..52762fd 100644
--- a/man/nowrapRecenter.Rd
+++ b/man/nowrapRecenter.Rd
@@ -24,7 +24,7 @@ nowrapSpatialPolygons(obj, offset = 0, eps=rep(.Machine$double.eps, 2))
 \author{Roger Bivand}
 
 
-\seealso{\code{\link[sp]{recenter}}, \code{\link[sp]{nowrapSpatialLines}}}
+\seealso{\code{\link[sp]{recenter-methods}}, \code{\link[sp]{nowrapSpatialLines}}}
 
 \examples{
 library(gpclib)

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



More information about the debian-science-commits mailing list