rcoordinatespoint-cloudslidr

Is there a way to plot the ''true'' coordinates on the x and y axis using lidR package


I want to plot a pointcloud in R using the lidR package. When I plot a pointcloud it automatically uses x and y axis values where the coordinates have been normalized starting from 0, I want to see the actual coordinates from the attribute of the las dataset.

LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile)
plot(las, axis = TRUE)

Solution

  • This is documented in plot

    clear_artifacts logical. It is a known and documented issue that the 3D visualisation with rgl displays artifacts. The points look aligned and/or regularly spaced in some view angles. This is because rgl computes with single precision float. To fix that the point cloud is shifted to (0,0) to reduce the number of digits needed to represent its coordinates. The drawback is that the point cloud is not plotted at its actual coordinates.

    plot(las, axis = TRUE, clear_artifacts = FALSE)
    

    This is also somehow documented in chapter 2.3 of the book.