2

I am working on the pre and post lidar earthquake data from Kumamoto, Japan. I would like to generate a DTM with the grid_terrain(pre_online, res = 1, algorithm = knnidw(k = 10L, p = 0.5)) function in R Studio. When I plot the data with plot_dtm3d() I get a weird looking one. Is someone familiar with this problem?

The data is available at https://portal.opentopography.org/lidarDataset?jobId=pc1620409032095.

enter image description here

The plot looks like this and it should be a 3D terrain model.

pre_online
#> class : LAS (v1.2 format 1) 
#> memory : 633 Mb 
#> extent : -12000, -9000.001, -21500, -19500 (xmin, xmax, ymin, ymax) 
#> coord. ref. : JGD2000 / Japan Plane Rectangular CS II (with axis order normalized for visualization) 
#> area : 6 km² 
#> points : 20.74 million 
#> points density : 3.46 points/m²
3
  • Don't know how to download the file but I'm pretty sure the XY coordinates are long/lat but Z is meters or feet. Please show the output of print(pre_online)
    – JRR
    Commented May 7, 2021 at 18:44
  • It is weird, because when I split the dataset in smaler pieces the output is correct. But when I do grid_terrain() for the whole dataset it gets this stick plot. Commented May 7, 2021 at 18:51
  • Ok I downloaded the file an reproduced
    – JRR
    Commented May 7, 2021 at 19:00

1 Answer 1

1

Your point cloud contains a lot of region with 0 ground points.

library(lidR)
las = readLAS("~/Téléchargements/points.laz", filter = "-keep_class 2")
plot(las)

enter image description here

Moreover if I look at ground points they do not look really "on the ground". I don't know how the classification have been made but it looks poor including a lot of points that are unlikely to be ground points

sub = clip_circle(las, -10000, -20000, 200)
plot(sub, axis = TRUE)

enter image description here

This may explain why grid_terrain failed and found infinite values. You can replace infinites by NA

dtm = grid_terrain(las, 2, tin())
dtm
#> class      : RasterLayer 
#> dimensions : 1000, 1500, 1500000  (nrow, ncol, ncell)
#> resolution : 2, 2  (x, y)
#> extent     : -12000, -9000, -21500, -19500  (xmin, xmax, ymin, ymax)
#> crs        : +proj=tmerc +lat_0=33 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs 
#> source     : memory
#> names      : Z 
#> values     : -2147484, 392.234  (min, max)
dtm[dtm < 0] = NA

Yet, your DTM is terrible and looks more like a CHM...

plot_dtm3d(dtm)

enter image description here

1
  • Thank you very much this helped me a lot! Commented May 7, 2021 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.