r-lidar / lidR

Airborne LiDAR data manipulation and visualisation for forestry application
https://CRAN.R-project.org/package=lidR
GNU General Public License v3.0
587 stars 132 forks source link

plot extent of las file with mapview #680

Closed wiesehahn closed 1 year ago

wiesehahn commented 1 year ago

lidR::plot() is able to plot a LAScatalog with mapview (e.g. plot(ctg, mapview=TRUE)).

With single LAS files this it not possible. Is there a reason for this or would it be possible to implement it so that plot(las, mapview=TRUE) will plot the extent of the LAS file on top of some basemap with mapview?

Jean-Romain commented 1 year ago
plot(header(las), mapview = TRUE)
wiesehahn commented 1 year ago

thanks, exactly that. Just seems a little inconsistent, but now I know.

Jean-Romain commented 1 year ago

plot(las) plots in 3D this is the default behavior expected by users I guess. I could add something like plot(las, 2d = TRUE) but this would also be inconsistant. I'm open to suggestion if you have an idea.

wiesehahn commented 1 year ago

I am fine with the current state now that I know how. But intuitively I expected that plot(x) returns a 3D plot (default and most expected by users) for LAS files and plot(x, mapview=TRUE) returns a 2D plot similar to the case if x is a LAScatalog. In the current state defining mapview=TRUE in the case of LASfiles does not change anything.

Jean-Romain commented 1 year ago

This argument does not exist for plot.LAS. It only exists for plot.LAScatalog but I could add it. That makes sense.

Jean-Romain commented 1 year ago

It is now possible to use plot(las, mapview = TRUE)