You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于LidR包中TIN算法生成DSM的技术咨询:首回波峰值偏差及算法细节疑问

Answers to Your LidR TIN Method Questions

Hey Michael, let's tackle your questions about the TIN-based DSM generation in the LidR package clearly:

1. Does the TIN triangulation use the average of multiple first echoes within a single pixel?

Nope, that's not how it works. By default, the tin() algorithm in LidR doesn't group points into pixels or calculate averages first. Instead, it performs a Delaunay triangulation directly on all the input points you provide. If your point cloud has multiple first-echo points in the same general area, the triangulation will use each individual point's X/Y/Z coordinates to form the triangular mesh—no averaging happens at the pixel level during the triangulation step. The DSM raster is then created by interpolating the height values from this mesh onto your desired grid resolution.

2. Can I get a DSM based on the highest first echo using LidR or other tools?

Absolutely! Here's how to do it in LidR with two straightforward approaches:

Approach 1: Filter points first, then build TIN DSM

First, extract only the first-echo points, then keep only the highest first-echo point for each unique X/Y location. Then use this filtered point cloud to generate your TIN DSM:

# Load your point cloud
library(lidR)
las <- readLAS("your_point_cloud.las")

# Step 1: Extract all first-echo points
first_echo <- filter_poi(las, ReturnNumber == 1)

# Step 2: Keep only the highest first-echo point per X/Y position
highest_first_echo <- filter_poi(first_echo, Z == max(Z), by = ~X + Y)

# Step 3: Generate TIN DSM from the filtered points
tin_dsm_highest <- grid_canopy(highest_first_echo, res = 1, algorithm = tin(max_edge = 3))

The max_edge parameter helps exclude overly large triangles caused by sparse points, which can reduce noise in your DSM.

Approach 2: Use a max-height algorithm instead of TIN

If you don't strictly need a TIN-based DSM, you can directly generate a max-first-echo DSM using the p2r algorithm (point-to-raster with max aggregation):

max_first_echo_dsm <- grid_canopy(first_echo, res = 1, algorithm = p2r(subcircle = 0, fun = max))

3. Details on LidR's TIN algorithm for DSM generation

The tin() algorithm in LidR relies on Delaunay triangulation of the input point cloud to create a continuous triangular surface. Here's a breakdown of how it works:

  • It takes all input points (unless you've filtered them beforehand) and constructs a set of non-overlapping triangles that cover the entire area of the point cloud.
  • For each raster grid cell, it finds which triangle (if any) the cell's center falls into, then performs linear interpolation between the three vertices of that triangle to compute the cell's height value.
  • If a grid cell falls outside the triangulation area (i.e., in a region with no nearby points), it will either return NA or use nearest-neighbor interpolation—this behavior can be adjusted with additional parameters.
  • You can use the max_edge argument to set a maximum allowed length for triangle edges. Any triangle with an edge longer than this value is excluded from the surface, which helps avoid unrealistic height interpolations in sparse point cloud areas.

内容的提问来源于stack exchange,提问作者Michael_vashni

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.28 16:47:34