Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ASDAR page refs for comment #67

Merged
merged 7 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: sp
Version: 1.3-2
Version: 1.3-4
Title: Classes and Methods for Spatial Data
Authors@R: c(person("Edzer", "Pebesma", role = c("aut", "cre"),
email = "edzer.pebesma@uni-muenster.de"),
Expand All @@ -15,7 +15,7 @@ Authors@R: c(person("Edzer", "Pebesma", role = c("aut", "cre"),
person("Joseph", "O'Rourke", role = "ctb"))
Depends: R (>= 3.0.0), methods
Imports: utils, stats, graphics, grDevices, lattice, grid
Suggests: RColorBrewer, rgdal (>= 0.8-7), rgeos (>= 0.3-13), gstat, maptools, deldir
Suggests: RColorBrewer, rgdal (>= 1.2-3), rgeos (>= 0.3-13), gstat, maptools, deldir
Description: Classes and methods for spatial
data; the classes document where the spatial location information
resides, for 2D or 3D data. Utility functions are provided, e.g. for
Expand Down
29 changes: 21 additions & 8 deletions R/CRS-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ if (!is.R()) {
}
}

"CRS" <- function(projargs=NA_character_, doCheckCRSArgs=TRUE) {
"CRS" <- function(projargs=NA_character_, doCheckCRSArgs=TRUE,
SRS_string=NULL) {
# cautious change BDR 150424
if (!is.na(projargs) && !nzchar(projargs)) projargs <- NA_character_
# condition added 140301
Expand Down Expand Up @@ -41,15 +42,27 @@ if (!is.R()) {
# if (length(grep("rgdal", search()) > 0) &&
# (sessionInfo()$otherPkgs$rgdal$Version > "0.4-2")) {
# sessionInfo()/read.dcf() problem in loop 080307
if (doCheckCRSArgs) {
if (!is.na(uprojargs) && requireNamespace("rgdal", quietly = TRUE)) {
res <- rgdal::checkCRSArgs(uprojargs)
if (!res[[1]])
stop(res[[2]])
uprojargs <- res[[2]]
}
comm <- NULL
if (doCheckCRSArgs && requireNamespace("rgdal", quietly = TRUE)) {
if ((length(grep("ob_tran", uprojargs)) > 0L) ||
packageVersion("rgdal") < "1.5.1") {
if (!is.na(uprojargs)) {
res <- rgdal::checkCRSArgs(uprojargs)
if (!res[[1]]) stop(res[[2]])
uprojargs <- res[[2]]
}
} else if (packageVersion("rgdal") >= "1.5.1") {
if (rgdal::new_proj_and_gdal()) {
res <- rgdal::checkCRSArgs_ng(uprojargs=uprojargs,
SRS_string=SRS_string)
if (!is.na(uprojargs) && !res[[1]]) stop(res[[2]])
uprojargs <- res[[2]]
comm <- res[[3]]
} else stop("rgdal version mismatch")
} else stop("rgdal version mismatch")
}
res <- new("CRS", projargs=uprojargs)
if (!is.null(comm)) comment(res) <- comm
res
}

Expand Down
4 changes: 2 additions & 2 deletions inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ citEntry(entry="book",
title = "Applied spatial data analysis with {R}, Second edition",
year = "2013",
publisher = "Springer, NY",
url = "http://www.asdar-book.org/",
url = "https://asdar-book.org/",
textVersion =
paste("Roger S. Bivand, Edzer Pebesma, Virgilio Gomez-Rubio, 2013.",
"Applied spatial data analysis with R, Second edition. Springer, NY.",
"http://www.asdar-book.org/")
"https://asdar-book.org/")
)
2 changes: 1 addition & 1 deletion inst/include/sp.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#endif
/* remember to touch local_stubs.c */

#define SP_VERSION "1.3-2"
#define SP_VERSION "1.3-4"

#include <R.h>
/* RSB 091203 */
Expand Down
3 changes: 2 additions & 1 deletion man/CRS-class.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ Objects can be created by calls of the form \code{CRS("projargs")}, where "proja
}
}
\usage{
CRS(projargs, doCheckCRSArgs=TRUE)
CRS(projargs, doCheckCRSArgs=TRUE, SRS_string=NULL)
identicalCRS(x,y)
}
\arguments{
\item{projargs}{A character string of projection arguments; the arguments must be entered exactly as in the PROJ.4 documentation; if the projection is unknown, use \code{as.character(NA)}, it may be missing or an empty string of zero length and will then set to the missing value.}
\item{doCheckCRSArgs}{default TRUE, must be set to FALSE by package developers including \code{CRS} in an S4 class definition to avoid uncontrollable loading of the \pkg{rgdal} namespace}
\item{SRS_string}{default NULL, experimental in connection with adaptation to GDAL>=3/PROJ>=6; a valid WKT string or SRS definition such as \code{"EPSG:4326"}}
\item{x}{object having a \link{proj4string} method,
or if \code{y} is missing, list with objects that have a \code{proj4string} method}
\item{y}{object of class \link{Spatial}, or having a \link{proj4string} method}
Expand Down
6 changes: 6 additions & 0 deletions man/SpatialPolygons-class.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ function \code{\link[rgeos]{createSPComment}} to add such comments to each Polyg
the polygons slot of this SpatialPolygons object. Exterior rings are coded
zero, while interior rings are coded with the 1-based index of the
exterior ring to which they belong. SpatialPolygons objects created by reading using \code{\link[rgdal]{readOGR}} from \pkg{rgdal} have the comments set on input, as OGR also uses SFS.

Refer to Bivand et al. (2013), pages 47-48 and 132-133 for a further discussion.
}

\note{
Expand All @@ -87,6 +89,10 @@ checked that all IDs are unique. If \code{rbind}-ing \code{SpatialPolygons} with
unique IDs, it is possible to set the argument \code{makeUniqueIDs = TRUE}, although
it is preferred to change these explicitly with \code{\link{spChFIDs}}.
}


\references{Roger Bivand, Edzer Pebesma and Virgilio Gomez-Rubio, 2013. Applied spatial data analysis with R, Second edition. Springer, NY. \url{https://asdar-book.org/}}

\author{ Roger Bivand }
\seealso{ \code{\link{SpatialPolygons}} }
\examples{
Expand Down
4 changes: 4 additions & 0 deletions man/SpatialPolygons.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ function \code{\link[rgeos]{createSPComment}} to add such comments to each Polyg
the polygons slot of this SpatialPolygons object. Exterior rings are coded
zero, while interior rings are coded with the 1-based index of the
exterior ring to which they belong. SpatialPolygons objects created by reading using \code{\link[rgdal]{readOGR}} from \pkg{rgdal} have the comments set on input, as OGR also uses SFS.

Refer to Bivand et al. (2013), pages 47-48 and 132-133 for a further discussion.
}

\value{
Expand All @@ -59,4 +61,6 @@ exterior ring to which they belong. SpatialPolygons objects created by reading u
}
\seealso{ \link{SpatialPolygons-class}, \link{SpatialPolygonsDataFrame-class} }

\references{Roger Bivand, Edzer Pebesma and Virgilio Gomez-Rubio, 2013. Applied spatial data analysis with R, Second edition. Springer, NY. \url{https://asdar-book.org/}}

\keyword{manip}
3 changes: 2 additions & 1 deletion man/as.SpatialPolygons.GridTopology.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ image(meuse.grid["dist"])
plot(xxpl, add = TRUE)
points(xx, cex = .5)
\dontrun{
spplot(aggregate(meuse.grid[,1:3], xxpl), main = "aggregated meuse.grid")
spplot(aggregate(as(meuse.grid[,1:3], "SpatialPolygonsDataFrame"), xxpl,
areaWeighted=TRUE), main = "aggregated meuse.grid")
}
}
\keyword{spatial}
2 changes: 1 addition & 1 deletion man/gridlines.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ l$srt = 0 # otherwise they end up upside-down
text(l)
title("grid line labels on polar projection, epsg 3031")
\dontrun{
demo(polar) # adds the map of the antarctic
if (require(maps)) demo(polar) # adds the map of the antarctic
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/sp.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#endif
/* remember to touch local_stubs.c */

#define SP_VERSION "1.3-2"
#define SP_VERSION "1.3-4"

#include <R.h>
/* RSB 091203 */
Expand Down