From 44e19690e76b4d63f54ab793162110479a69ef09 Mon Sep 17 00:00:00 2001 From: Jean-Romain Date: Fri, 27 Sep 2019 11:04:30 -0400 Subject: [PATCH] #283 --- NEWS.md | 2 ++ R/utils_raster.r | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 39c76ba9..3b88df7b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -14,6 +14,8 @@ 6. Tolerance for internal `point_in_triangle()` have been increased to fix double precision error in rasterization of a triangulation. This fixes some rare `NA`s in `pitfree()`, `dsmtin()` and `tin()`. +7. The NAs are now correctly interpreted when writing a GDAL virtual raster [#283](https://github.com/Jean-Romain/lidR/issues/283). + ## lidR v2.1.3 (Release date: 2019-09-10) #### NEW FEATURES diff --git a/R/utils_raster.r b/R/utils_raster.r index a5410351..5ca27398 100644 --- a/R/utils_raster.r +++ b/R/utils_raster.r @@ -115,7 +115,7 @@ rBuildVRT = function(file_list, vrt) folder <- dirname(file_list[1]) file <- paste0("/", vrt, ".vrt") vrt <- paste0(folder, file) - gdalUtils::gdalbuildvrt(file_list, vrt) + gdalUtils::gdalbuildvrt(file_list, vrt, vrtnodata = -Inf) file_list <- raster::stack(vrt) if (dim(file_list)[3] == 1)