La continuité du service gitlab.irstea.fr sera assurée en 2020. Nous envisageons ensuite une évolution vers une forge nationale INRAE encore à construire. Nous vous tiendrons au courant des évolutions futures.

...
 
Commits (2)
......@@ -610,6 +610,7 @@ cimg2Raster <- function(cimg, rasterLayer=NULL)
#'
#' @param rasterLayer raster object. raster of canopy height model, preferably filtered to avoid effect of holes on volume and surface computation
#' @param NA.replace numeric. value to replace NA values with.
#' @param maxpixels numeric. maximum number of pixels to be converted to cimg (argument passed to as.cimg).
#' @return A cimg object
#' @examples
#' data(chmchablais3)
......@@ -624,10 +625,11 @@ cimg2Raster <- function(cimg, rasterLayer=NULL)
#' plot(chm.cim)}
#' @seealso \code{\link{cimg2Raster}}
#' @export
raster2Cimg <- function(rasterLayer, NA.replace=0)
raster2Cimg <- function(rasterLayer, NA.replace=0, maxpixels=1e+7)
{
# replace NA values
rasterLayer[is.na(rasterLayer)] <- NA.replace
# convert to cimg object
imager::as.cimg(rasterLayer)
if (rasterLayer@ncols*rasterLayer@nrows>maxpixels) {warning("Too many rasterLayer pixels: conversion to cimg partial; try with higher maxpixels arguments")}
imager::as.cimg(rasterLayer, maxpixels=maxpixels)
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ ABAinference(modell, r.predictions, type = c("SRS", "ED", "D", "STR",
"SYNT"), r.mask = NULL)
}
\arguments{
\item{modell}{a model returned by by \code{\link{ABA.model}} or \code{\link{combine.stratified.ABA.models}}}
\item{modell}{a model returned by by \code{\link{ABAmodel}} or\code{\link{ABAmodelCombineStrata}}}
\item{r.predictions}{raster of predicted values}
......
......@@ -2,12 +2,12 @@
% Please edit documentation in R/aba.R
\name{ABAmodelPlot}
\alias{ABAmodelPlot}
\title{plots observed and predicted values of a model returned by \code{\link{ABA.model}}}
\title{plots observed and predicted values of a model returned by \code{\link{ABAmodel}}}
\usage{
ABAmodelPlot(modell, title = NULL, unit = NULL, disp.text = F)
}
\arguments{
\item{modell}{list .as returned by \code{\link{ABA.model}}}
\item{modell}{list. as returned by \code{\link{ABAmodel}}}
\item{title}{string. the plot title}
......
......@@ -7,15 +7,15 @@
ABApredict(modell, map.metrics, strata = NULL)
}
\arguments{
\item{modell}{a model returned by \code{\link{ABAmodel}} or \code{\link{ABAmodelCombineStrata}}}
\item{modell}{model returned by \code{\link{ABAmodel}} or \code{\link{ABAmodelCombineStrata}}}
\item{map.metrics}{metrics returned e.g by \code{\link[lidR]{grid_metrics}}}
\item{map.metrics}{RasterStack. metrics returned e.g by \code{\link[lidR]{grid_metrics}}}
\item{strata}{a factor vector. levels corresponding to \code{strata} in \code{modell}}
\item{strata}{string. indicates which layer of map.metrics contains the \code{strata} in \code{modell}}
}
\value{
a vector of predictions obtained by applying the model \code{modell} to the observations (lines) in \code{map.metrics}
a raster of predictions obtained by applying the model \code{modell} to the observations in \code{map.metrics}
}
\description{
applies calibrated area-based prediction models output of \code{\link{ABA.model}} to a dataframe of new metrics
applies calibrated area-based prediction models output of \code{\link{ABAmodel}} to a RasterStack of new metrics
}
......@@ -4,12 +4,14 @@
\alias{raster2Cimg}
\title{RasterLayer to Cimg conversion}
\usage{
raster2Cimg(rasterLayer, NA.replace = 0)
raster2Cimg(rasterLayer, NA.replace = 0, maxpixels = 1e+07)
}
\arguments{
\item{rasterLayer}{raster object. raster of canopy height model, preferably filtered to avoid effect of holes on volume and surface computation}
\item{NA.replace}{numeric. value to replace NA values with.}
\item{maxpixels}{numeric. maximum number of pixels to be converted to cimg (argument passed to as.cimg).}
}
\value{
A cimg object
......