Skip to content

Commit 4d4f2c6

Browse files
committed
add ref to geosphere::regularCoordinates
1 parent 01c549c commit 4d4f2c6

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

R/sample.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ st_sample = function(x, size, ...) UseMethod("st_sample")
3535
#'
3636
#' Fibonacci sampling see: Alvaro Gonzalez, 2010. Measurement of Areas on a Sphere Using Fibonacci and Latitude-Longitude Lattices.
3737
#' Mathematical Geosciences 42(1), p. 49-64
38+
#'
39+
#' For regular sampling on the sphere, see also \code{geosphere::regularCoordinates}.
3840
#'
3941
#' Sampling methods from package \code{spatstat} are interfaced (see examples), and need their own parameters to be set.
4042
#' For instance, to use \code{spatstat.random::rThomas()}, set \code{type = "Thomas"}.

man/st_sample.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/stars.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ List CPL_read_gdal(CharacterVector fname, CharacterVector options, CharacterVect
366366
CharacterVector descriptions(bands.size());
367367
NumericMatrix ranges(bands.size(), 4);
368368
IntegerMatrix blocksizes(bands.size(), 2);
369+
IntegerVector colorInterp(bands.size());
369370
for (int i = 0; i < bands.size(); i++) {
370371
if ((poBand = poDataset->GetRasterBand(bands(i))) == NULL)
371372
stop("trying to read a band that is not present");
@@ -391,6 +392,7 @@ List CPL_read_gdal(CharacterVector fname, CharacterVector options, CharacterVect
391392
poBand->GetBlockSize(&nBlockXSize, &nBlockYSize);
392393
blocksizes(i, 0) = nBlockXSize;
393394
blocksizes(i, 1) = nBlockYSize;
395+
colorInterp(i) = (int) poBand->GetColorInterpretation();
394396
}
395397

396398
// get metadata items:
@@ -462,7 +464,8 @@ List CPL_read_gdal(CharacterVector fname, CharacterVector options, CharacterVect
462464
_["blocksizes"] = blocksizes,
463465
_["descriptions"] = descriptions,
464466
_["default_geotransform"] = default_geotransform,
465-
_["proxy"] = LogicalVector::create(!read_data)
467+
_["proxy"] = LogicalVector::create(!read_data),
468+
_["colorInterp"] = colorInterp
466469
);
467470
if (read_data) {
468471
ReturnList.attr("data") = read_gdal_data(poDataset, nodatavalue, nXOff, nYOff,

0 commit comments

Comments
 (0)