-1

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)
JRR
  • 3,024
  • 2
  • 13
  • 37
N_LLC
  • 109
  • 2
  • 1
    It's easier to help you if you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. – MrFlick May 31 '22 at 12:28
  • @MrFlick I am working with a 800mb dataset so it is a bit too big to share here. But the dataset contains the x, y and z coordinates as attributes. When I plot the pointcloud it does show the x and y axis, but it automatically starts all values from 0. – N_LLC May 31 '22 at 12:37
  • 1
    Does the package itself contain sample data? If you show some runnable code it's much easier to see exactly what functions are being used and debug the code to see what options are available. – MrFlick May 31 '22 at 12:38
  • @MrFlick its my first date on R so sorry if im being unclear. This is my code: library(lidR) las <- readLAS("G:/Spain & Portugal/merged700.las") plot(las) plot(las, color ="RGB") las <- classify_ground(las, algorithm = pmf(ws = 5, th = 3)) plot(las, color = "Classification", axis=TRUE, size = 3, bg = "white") – N_LLC May 31 '22 at 12:53

1 Answers1

1

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.

JRR
  • 3,024
  • 2
  • 13
  • 37