r-lidar / lasR

Fast and Pipable Airborne LiDAR Data Tools
https://r-lidar.github.io/lasR/
GNU General Public License v3.0
54 stars 1 forks source link

triangulate returns a square raster with reader_circle #80

Closed Jean-Romain closed 1 month ago

Jean-Romain commented 1 month ago
library(lasR)
f <- system.file("extdata", "Topography.las", package = "lasR")

read = reader_las_circles(273500, 5274500, 20) 
del = triangulate(filter = keep_ground())

pipeline1 = read + dtm(1)
pipeline2 = read + rasterize(1)
pipeline3 = read + del + rasterize(1, del)

ans <- exec(pipeline1, on = f)
terra::plot(ans)


ans <- exec(pipeline2, on = f)
terra::plot(ans)


ans <- exec(pipeline3, on = f)
terra::plot(ans)

Created on 2024-07-24 with reprex v2.1.0

Originally posted by @wiesehahn in https://github.com/r-lidar/lasR/issues/79#issuecomment-2247195682

Jean-Romain commented 1 month ago

Reproducible with simple raster and a buffer (v 0.10.0). Buffer removal applied to the raster does not account for the shape of the data and is always based on a rectangle.

library(lasR)
f <- system.file("extdata", "Topography.las", package = "lasR")

ans <- exec(reader_las_circles(273500, 5274500, 20) + rasterize(2, "z_mean"), on = f)
terra::plot(ans)


ans <- exec(reader_las_circles(273500, 5274500, 20) + rasterize(2, "z_mean"), on = f, buffer = 50)
terra::plot(ans)

Created on 2024-07-24 with reprex v2.1.0

Jean-Romain commented 1 month ago

Fixed