Skip to content

Commit e0ebf5f

Browse files
committed
m
1 parent 4ce8fd1 commit e0ebf5f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

man/sample.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Take a spatial sample from a SpatRaster, SpatVector or SpatExtent. Sampling a Sp
1414

1515
With a SpatRaster, you can get cell values, cell numbers (\code{cells=TRUE}), coordinates (\code{xy=TRUE}) or (when \code{method="regular"} and \code{as.raster=TRUE}) get a new SpatRaster with the same extent, but fewer cells.
1616

17-
In order to assure regularity when requesting a regular sample, the number of cells or points returned may not be exactly the same as the \code{size} requested.
17+
In order to assure regularity when requesting a regular sample, the number of cells or points returned may not be exactly the same as the \code{size} requested unless you use \code{exact=TRUE}.
1818
}
1919

2020
\usage{

man/terra-package.Rd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,9 @@ Apart from the function listed below, you can also use indexing with \code{[} wi
189189
\code{\link{as.data.frame}} \tab get cell values as a data.frame (including class lables)\cr
190190
\code{\link{extract}} \tab Extract cell values from a SpatRaster (with cell numbers, coordinates, points, lines, or polygons)\cr
191191
\code{\link{extractAlong}} \tab Extract cell values along a line such that the values are in the right order\cr
192-
\code{\link{spatSample}} \tab Regular or random sample \cr
192+
\code{\link{spatSample}} \tab Take a sample (regular, random, stratified, weighted) sample from a SpatRaster\cr
193193
\code{\link{minmax}} \tab Get the minimum and maximum value of the cells of a SpatRaster (if known) \cr
194194
\code{\link{setMinMax}} \tab Compute the minimum and maximum value of a SpatRaster if these are not known \cr
195-
\code{\link{extract}} \tab spatial queries of a SpatRaster with a SpatVector\cr
196195

197196
--------------------------- \tab ------------------------------------------------------------------------------------------ \cr
198197
}
@@ -430,6 +429,7 @@ We use the term "attributes" for the tabular data (data.frame) associated with v
430429

431430
\tabular{ll}{
432431
\code{\link{extract}} \tab spatial queries between SpatVector and SpatVector (e.g. point in polygons) \cr
432+
\code{\link{spatSample}} \tab Take a regular or random point sample from polygons or lines\cr
433433
\code{\link{sel}} \tab select - interactively select geometries\cr
434434
\code{\link{click}} \tab identify attributes by clicking on a map\cr
435435
\code{\link{merge}} \tab Join a table with a SpatVector \cr
@@ -679,11 +679,11 @@ Also note that even if function names are the same in \code{terra} and \code{ras
679679
}
680680
681681
\section{Authors}{
682-
Except where indicated otherwise, the methods and functions in this package were written by Robert Hijmans. The configuration scripts were written by Roger Bivand. Some of code using the GEOS library was adapted from code by Edzer Pebesma for \code{sf}. Michael Sumner contributed various bits and pieces.
682+
Except where indicated otherwise, the methods and functions in this package were written by Robert Hijmans. The configuration scripts were written by Roger Bivand. Some of code using the GEOS library was adapted from code by Edzer Pebesma for \code{sf}. Emanuele Cordano contributed functionality for catchment related computations. Andrew Gene Brown, Márcia Barbosa, Michael Chirico, Krzysztof Dyba, Barry Rowlingson, and Michael D. Sumner also provided major contributions
683683
}
684684
685685
\section{Acknowledgments}{
686-
This package is an attempt to climb on the shoulders of giants (GDAL, PROJ, GEOS, NCDF, GeographicLib, Rcpp, R). Many people have contributed by asking questions or \href{https://github.com/rspatial/terra}{raising issues}. Feedback and suggestions by Márcia Barbosa, Kendon Bell, Andrew Gene Brown, Jean-Luc Dupouey, Krzysztof Dyba, Sarah Endicott, Derek Friend, Alex Ilich, Gerald Nelson, Jakub Nowosad, and Monika Tomaszewska have been especially helpful.
686+
This package is an attempt to climb on the shoulders of giants (GDAL, PROJ, GEOS, NCDF, GeographicLib, Rcpp, R). Many people have contributed by asking questions or \href{https://github.com/rspatial/terra}{raising issues}. Feedback and suggestions by Kendon Bell, Jean-Luc Dupouey, Sarah Endicott, Derek Friend, Alex Ilich, Gerald Nelson, Jakub Nowosad, and Monika Tomaszewska have been especially helpful.
687687
}
688688
689689

src/sample.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,8 @@ SpatVector SpatVector::sample(unsigned n, std::string method, unsigned seed) {
764764
k++;
765765
if (k == n) { break; }
766766
}
767-
oldlength = length;
768767
if (k == n) { break; }
768+
oldlength = length;
769769
}
770770
if (k == n) { break; }
771771
}

0 commit comments

Comments
 (0)