lidr LAS目录 手动分类

huangapple go评论65阅读模式
英文:

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 &lt;- 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&lt;-list.files(mylasfiles)
cg&lt;-readLAScatalog(l[1:10], filter = &quot;-change_classification_from_to 8 2&quot;) # does not work
cg&lt;-readLAScatalog(l[1], filter = &quot;-change_classification_from_to 8 2&quot;) # 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>



huangapple
  • 本文由 发表于 2023年7月24日 20:09:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76754364.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定