Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGrid_Terrain In absence of class 2 #350
Comments
lidDat = readLAS(Path)
unique(lidDat@data$Classification)
#> [1] 6 1 8
dtm= lidR::grid_terrain(lidDat,res = 0.25,algorithm=knnidw(k=10L),use_class = c(1L))
#> Error: No ground points found. Impossible to compute a DTM. |
|
Try to use readLAS(path, filter = "-change_classification_from_to 1 2") |
|
Also grid_terrain(lidDat,res = 0.25,algorithm=knnidw(k=10L),use_class = c(1L, 2L))Should do the job no? |
No, this one does not do, as there is no 2 class in some. Yes, reclassification does help. I already tried doing the reclassification and it worked fine. |
|
If there is no class 2 then only class 1 will be used. I don't understand why |
Yes, this is precisely why I raised the issue. I could always reclassify but I didn't understand why it does not work. `> lidDat = readLAS(Path)
|
|
Ho ok I got it. Will see that tomorrow. It looks like a bug. Are you able to share a small file that I'll be able to use to reproduce. |
Yes sure, can I directly send it to you without keeping it public? |
|
As you wish |
|
Fixed. You can install from github or wait few more day I will release v3.0.1 soon. The problem was that when I introduced Thank you for reporting |
Ah thank you so much for your quick action. Will do. Cheers |
First just to mention, I have used liDR extensively all through my doctoral thesis and I can not thank you enough for such great and easy tools.
There has always been one issue that I wanted to raise is the issue of Grid_Terrain when there is no class 2. So one data provider did not follow LAS specifications and classified ground points in class 1 and 2 as unclassified points, and in some tiles, there are no unclassified points. So obviously in some tiles, there is no 2.
However, when I use class 1L for grid_terrain, for some tiles where 2L is missing I keep on getting "No ground points found. Impossible to compute a DTM." I have checked the source code and I think this is forced in even if class chosen for interpolation is different.
I know how to surpass it, I just kept Null class as 2 and I can still run it. But I wish I do not have to do it.