Skip to content

Commit 6dc7cbe

Browse files
committed
'things'
1 parent 0301caf commit 6dc7cbe

9 files changed

+33
-9
lines changed

.Rbuildignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.gitignore
22
LICENSE
3-
README.md
3+
README.md
4+
revdep

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
*.dll
99
*.zip
1010
.Rproj.user
11+
revdep

R/bind.R

+10
Original file line numberDiff line numberDiff line change
@@ -351,3 +351,13 @@ setMethod('bind', signature(x='SpatialPoints', y='SpatialPoints'),
351351
)
352352

353353

354+
355+
setMethod('bind', signature(x='list', y='missing'),
356+
function(x, y, ..., keepnames=FALSE) {
357+
if (length(x) < 2) { return(unlist(x)) }
358+
names(x)[1:2] <- c('x', 'y')
359+
x$keepnames <- keepnames
360+
do.call(bind, x)
361+
}
362+
)
363+

R/rasterOptions.R

+6-2
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,12 @@ tmpDir <- function(create=TRUE) {
416416
}
417417

418418

419-
.datatype <- function(..., datatype) {
420-
if (missing(datatype)) {
419+
.datatype <- function(..., datatype, dataType) {
420+
421+
if (missing(datatype) && !missing(dataType)) {
422+
warning('argument "datatype" misspelled as "dataType"')
423+
datatype <- dataType
424+
} else if (missing(datatype)) {
421425
datatype <- getOption('rasterDatatype')
422426
if (is.null(datatype)) {
423427
return('FLT4S')

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ If you are windows, you need to first install [Rtools](https://cran.r-project.or
1414

1515
On [rspatial.org](http://rspatial.org/) you can learn about spatial data analysis with R.
1616

17-
[stackoverflow](https://stackoverflow.com/) is the best place to ask questions of you get stuck. Make sure to include a simple reproducible example.
17+
[stackoverflow](https://stackoverflow.com/) is the best place to ask questions of you get stuck. Make sure to include a [https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example](simple reproducible example).
1818

1919
Please send me an email if you have a bug report. See `maintainer("raster")` for the email address.
2020

man/Rcpp-classes.Rd

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
\docType{class}
44

55

6-
\alias{SpExtent}
76
\alias{SpPoly}
87
\alias{SpPolyPart}
98
\alias{SpPolygons}
109
\alias{SpExtent}
10+
1111
\alias{SpPoly-class}
1212
\alias{SpPolyPart-class}
1313
\alias{SpPolygons-class}
1414
\alias{Rcpp_SpExtent-class}
15+
1516
\alias{Rcpp_SpPolygons-class}
1617
\alias{Rcpp_SpPoly-class}
1718
\alias{Rcpp_SpPolyPart-class}

man/bind.Rd

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
\docType{methods}
44

55
\alias{bind}
6+
67
\alias{bind,SpatialPolygons,SpatialPolygons-method}
78
\alias{bind,SpatialLines,SpatialLines-method}
89
\alias{bind,SpatialPoints,SpatialPoints-method}
910
\alias{bind,matrix,matrix-method}
1011
\alias{bind,matrix,missing-method}
1112
\alias{bind,data.frame,data.frame-method}
1213
\alias{bind,data.frame,missing-method}
14+
\alias{bind,list,missing-method}
15+
1316

1417
\title{
1518
Bind Spatial* objects
@@ -27,12 +30,14 @@ Bind (append) Spatial* objects into a single object. All objects must be of the
2730
\S4method{bind}{SpatialPoints,SpatialPoints}(x, y, ..., keepnames=FALSE)
2831

2932
\S4method{bind}{data.frame,data.frame}(x, y, ..., variables=NULL)
33+
34+
\S4method{bind}{list,missing}(x, y, ..., keepnames=FALSE)
3035
}
3136

3237

3338
\arguments{
34-
\item{x}{Spatial* object or data.frame}
35-
\item{y}{Spatial* object or data.frame}
39+
\item{x}{Spatial* object or data.frame, or a list of Spatial* objects}
40+
\item{y}{Spatial* object or data.frame, or missing}
3641
\item{...}{Additional Spatial* objects}
3742
\item{keepnames}{Logical. If \code{TRUE} the row.names are kept (if unique)}
3843
\item{variables}{character. Variable (column) names to keep, If \code{NULL}, all variables are kept}

src/rasterize.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/* Robert Hijmans, June 2011, July 2016
2+
// Based on public-domain code by Darel Rex Finley, 2007
3+
// http://alienryderflex.com/polygon_fill/
24
35
*/
46
#include <Rcpp.h>
@@ -36,9 +38,9 @@ std::vector<double> rasterize_polygon(std::vector<double> r, double value, std::
3638
if (nCol[i] >= ncols) break;
3739
if (nCol[i+1] > 0) {
3840
if (nCol[i] < 0) nCol[i]=0 ;
39-
if (nCol[i+1] >= ncols) nCol[i+1] = ncols-1;
41+
if (nCol[i+1] >= ncols) nCol[i+1] = ncols;
4042
int ncell = ncols * row;
41-
for (size_t col = nCol[i]; col <= nCol[i+1]; col++) {
43+
for (size_t col = nCol[i]; col < nCol[i+1]; col++) {
4244
r[col + ncell] = value;
4345
}
4446
}

src/rasterize.o

-16 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)