英文:
lidr LAScatalog manual classification
问题
我有一些不太常见的LAS瓦片。我知道我的所有点都表示“地面”。LAS文件已经经过预处理和分类。但所有的点都是Class = 8L。我需要将它们全部重新分类为2L,以便能够将它们作为地形进行处理。
我看到对于LAS类别,其中包括Classification槽位,它的工作正常。las$Classification <- 2L
但如何在LAScatalog中执行此操作呢?我尝试了几种方法,但没有成功。也许可以定义一个自定义分类器?
编辑:
@JRR提出的解决方案对我来说完全有效,但仅适用于单个LAS瓦片,不适用于LAScatalog。
l <- list.files(mylasfiles)
cg <- readLAScatalog(l[1:10], filter = "-change_classification_from_to 8 2") # 不起作用
cg <- readLAScatalog(l[1], filter = "-change_classification_from_to 8 2") # 正常工作
英文:
I have a bit of an unusual LAS tiles. I know that all my points represent "ground". The LAS files were already pre-processed and classified. But all the points are Class = 8L. I need to reclassify all of them to 2L to be able to work with them as terrain.
I see it works fine for LAS class, where the Classification slot is. las$Classification <- 2L
but how to do this for LAScatalog? I tried several ways but no success. Maybe it is possible to define a custom Classifier?
EDIT:
Proposed spolution by @JRR works perfectly for me, but only for single las tile, not for LAScatalog.
l<-list.files(mylasfiles)
cg<-readLAScatalog(l[1:10], filter = "-change_classification_from_to 8 2") # does not work
cg<-readLAScatalog(l[1], filter = "-change_classification_from_to 8 2") # works fine
答案1
得分: 1
你不需要重写你的文件,你可以在读取时进行转换。
```python
readLAS(file, filter="-change_classification_from_to 8 2")
你也可以使用 LAScatalog
来完成相同的操作。
readLAScatalog(file, filter="-change_classification_from_to 8 2")
<details>
<summary>英文:</summary>
You do not need to rewrite your file, you can transform at read time
readLAS(file, filter = "-change_classification_from_to 8 2")
You can do the same with a `LAScatalog`
readLAScatalog(file, filter = "-change_classification_from_to 8 2")
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论