1

要获得具有特定区域的 las 数据集的圆形子集,我想使用 lidR::clip_circular()。为此,我首先计算我的 las 数据集的中心点,然后定义我想要使用的半径,以从我的 las 数据集的质心获得正好 500m^2 的子集。该操作有效并且不会引发任何错误,但是结果不正确,请参阅我的短代码片段末尾的 base::print() 。

我也尝试使用 lidR::clip_roi() ,提供一个代表我感兴趣的区域的多边形,但得到了相同的错误结果。现在我不知道如何继续下去。我可以想象,这是关于我正在使用的 crs (EPSG:25832)或者因为该区域是圆形而不是矩形......

las_ctpt <- sf::st_coordinates(sf::st_centroid(sf::st_as_sfc(sf::st_bbox(las_norm, crs = crs_epsg25832), crs = crs_epsg25832), crs = crs_epsg25832))
# get the centroid of the (normalized) las-dataset

buff_radius <- base::sqrt(500/pi)
# calculate the radius to get a circular subset with an area of exactly 500m^2 of the las-dataset

las_subset <- lidR::clip_circle(las = las_norm, radius = buff_radius, xcenter = las_ctpt[, 1], ycenter = las_ctpt[, 2])
# subset the (normalized) las-file

base::print(las_subset)
class        : LAS (v1.4 format 6)
memory       : 3.7 Mb 
extent       : 78????.?, 78????.?, 528????, 528???? (xmin, xmax, ymin, ymax)
coord. ref.  : ETRS89 / UTM zone 32N 
area         : 604 m²
points       : 38.9 thousand points
density      : 64.45 points/m²
density      : 47.87 pulses/m²

las_subset_rect <- ((base::sqrt(500/pi))*2)^2
# this should be a rectangular box around the subset I want to have with an area of: (radius*2)^2

base::print(las_subset_rect)
[1] 636.6198

(请注意,由于隐私问题,我已将研究区域的确切位置涂黑。但是,我使用的是 EPSG:25832,这是德国使用的公制 CRS。)

4

0 回答 0