diff --git a/R/compute_viewshed.R b/R/compute_viewshed.R index ceea8a0..5b9c632 100644 --- a/R/compute_viewshed.R +++ b/R/compute_viewshed.R @@ -12,7 +12,7 @@ #' @param offset_height numeric, setting the height of positions that a given #' viewpoint will look at. (defaut is 0) #' @param r Numeric (optional), setting the radius for viewshed analysis. -#' (it is defaulted as NULL) +#' (The default is 1000m/3281ft) #' @param parallel Logical, (default is FALSE) indicating if parallel computing #' should be used to compute viewsheds of multiview points. When it is TRUE, #' arguements 'raster' and 'plot' are ignored diff --git a/man/compute_viewshed.Rd b/man/compute_viewshed.Rd index fad7c81..073668b 100644 --- a/man/compute_viewshed.Rd +++ b/man/compute_viewshed.Rd @@ -29,7 +29,7 @@ or a matrix including several viewpoints with x,y coordinates} viewpoint will look at. (defaut is 0)} \item{r}{Numeric (optional), setting the radius for viewshed analysis. -(it is defaulted as NULL)} +(The default is 1000m/3281ft)} \item{parallel}{Logical, (default is FALSE) indicating if parallel computing should be used to compute viewsheds of multiview points. When it is TRUE, diff --git a/src/viewscape.so b/src/viewscape.so index a63a040..c2ea07e 100755 Binary files a/src/viewscape.so and b/src/viewscape.so differ diff --git a/src/visibleLabel.cpp b/src/visibleLabel.cpp index 2f7806d..d941e79 100644 --- a/src/visibleLabel.cpp +++ b/src/visibleLabel.cpp @@ -13,20 +13,21 @@ Rcpp::IntegerMatrix visibleLabel( const double h, const int max_dis) { - Rcpp::NumericVector zl; - Rcpp::NumericVector xl; - Rcpp::NumericVector yl; + // Rcpp::NumericVector zl; + // Rcpp::NumericVector xl; + // Rcpp::NumericVector yl; const int rows = dsm.rows(); const int cols = dsm.cols(); int steps; Rcpp::IntegerMatrix visible(rows, cols); + Rcpp::NumericVector sequence(max_dis), xl(max_dis), yl(max_dis), zl(max_dis); for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { steps = sqrt((viewpoint[0]-j)*(viewpoint[0]-j) + (viewpoint[1]-i)*(viewpoint[1]-i)); const double z = dsm(i,j) + h; if (steps <= max_dis) { - Rcpp::NumericVector sequence(steps); + // Rcpp::NumericVector sequence(steps); std::iota(sequence.begin(), sequence.end(), 1); xl = viewpoint[0] + sequence * (j-viewpoint[0])/steps; yl = viewpoint[1] + sequence * (i-viewpoint[1])/steps; diff --git a/src/visibleLabel.o b/src/visibleLabel.o index 85b6eda..a883ac4 100644 Binary files a/src/visibleLabel.o and b/src/visibleLabel.o differ