To get a circular subset of a las-dataset with specific area, I would like to use lidR::clip_circular(). To do so, I first calculate the central point of my las-dataset, then I define the radius I want to use, to get a subset of exactly 500m^2 from the centroid of my las-dataset. The operation works and does not throw any error, the result however is not correct, see base::print() at the end of my short code snippet.
I have tried to use lidR::clip_roi() as well, providing a polygon representing my region of interest, but got the same, incorrect result. Now I do not have any clue how to go on. I could imagine, that it is about the crs I am using (EPSG:25832) or because the area is circular and not rectangular...
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
(Please note, that I have blackened out the exact location of my study area because of privacy issues. However, I am using EPSG:25832 which is a metric CRS used in Germany.)