lidR | R package for airborne LiDAR data manipulation | Navigation library
kandi X-RAY | lidR Summary
kandi X-RAY | lidR Summary
lidR .
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of lidR
lidR Key Features
lidR Examples and Code Snippets
Community Discussions
Trending Discussions on lidR
QUESTION
I have folder where many lidar(.las) files. It looks like
...ANSWER
Answered 2022-Apr-17 at 11:33Maybe somthing like this
QUESTION
I have a question regarding to the TIN method used in LidR. My point cloud data is look like this figure. When I compute DSM using TIN method, the height value is not at the highest peak of first return. Does the value used in triangulation is an average value from several first return within one pixel? Is there any ways to retrieve the DSM from the highest first return using LidR or another software? Thank you.
- Michael -
I am expecting to retrieve clarification about the TIN algorithm used to generate DSM in LidR package.
...ANSWER
Answered 2022-Mar-30 at 23:41lidR triangulates the first returns and interpolates at the location of the centers of the pixels. So if a pixel is at the center of a triangle the value it returns is a linear combination of the elevation of the 3 points of the corresponding triangle. In your example the pixels look very big. Consequently the center of the pixel is somewhere in one of the many triangles encompassed by the pixel. It'd say it is relatively meaningless to compute a triangulation-based CHM with a resolution much larger than the average point spacing.
If you want to make a CHM that correspond to the highest point use a point-to-raster based method i.e. p2r()
.
QUESTION
Lidar data is simply 3d coordinates, usually in las
file format. Сontent example
ANSWER
Answered 2022-Mar-19 at 08:58Please find below one possible solution to get a data.table,data.frame
with all the information. You can use as.data.frame()
to get a pure data.frame
but a data.table
is a data.frame
Reprex
NB: I used a .las
dataset built in the lidR
library as it is more convenient.
- The example dataset from
lidR
QUESTION
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...
...ANSWER
Answered 2022-Mar-07 at 16:39I can reproduce your issue with example data
QUESTION
The lidR package has a neat way to work with huge (pointcloud) datasets: The catalog
function (doc here) avoids loading the dataset to memory and can treat mosaics [datasets that are spread across multiple (non-overlapping) tiles] as single dataset. It loads required tiles on-the-fly during computations in an intelligent way. It is great to avoid working with huge files (multiple GBs) and keep memory requirements lean if only working with small parts of the dataset.
Is there a similar convenient/memory-efficient/"lidR-catalog-way" to process large raster mosaics in R? Or more put in a more general way: Is there a way to work with mosaic raster datasets in R without merging them first?
I am aware of the mosaic
(doc) and merge
functions, which allow me to merge my tiled raster mosaic into a single raster dataset. I also found that gdal
will do so a lot faster and memory efficient. Here is a R-snippet for this:
ANSWER
Answered 2021-Nov-30 at 16:52You should look into the terra
package which provides exactly the functionality you're looking for through virtual raster tiles (VRTs). We can use them to treat a collection of raster files on disk as a single raster file while taking advantage of the API to do a majority of the same tasks as you can do through the raster
package.
First, let's create a sample of 4 rasters using the example straight from the ?terra::vrt()
documentation.
QUESTION
I created a local package with personal functions to be easily used within R. One of these is aimed to be used in the lidR
package within a wrapper function (i.e. grid_metrics
). For this reason I took the scheme of this script as a reference, exporting both the long name (e.g. my_metrics(param1, param2,...)
) and the lazy one (e.g. .my_metrics
), because I really like its ease of use.
Nevertheless, if I load my package and then call the lazy function
...ANSWER
Answered 2021-Oct-14 at 08:19It seems that the problem is related to the DESCRIPTION
section in which the lidR
package was included. Since when I moved from Imports
to Depends
the issue is solved.
QUESTION
I have large point clouds (each with several million points) and want to compute geometric attributes for all points. In order to do so, I need to calculate eigenvalues. How can I do this as quickly as possible? My data is stored in *.las files and I read them in with the package lidR. I also use this package to calculate point metrics. According to this post, I implemented this version:
...ANSWER
Answered 2021-May-02 at 11:41The problem of point_metrics()
is that it calls user's R code millions of times and this have a cost. Moreover it cannot be safely multithreaded. The function is good for prototyping but for production you must write your own code. For example you can reproduce the function segment_shape()
with point_metrics()
but segment_shape()
is pure C++ and multi-threaded and is often an order of magnitude faster.
Let try with ~3 millions points. The two examples are not equivalent (different output) but the computation load is almost the same (eigen value decomposition).
QUESTION
Is there a way to export a *.las point cloud in R to a orthomosaic? I loaded my las-file containing the points with the package lidR. I want to export a tif which shows the point cloud from above in RGB, similar to what an orthophoto would look like. The data was collected using a terrestrial laser scanner.
...ANSWER
Answered 2021-Mar-29 at 12:29Okay, so I figured out how to do it, although it's not very elegant:
QUESTION
I have a possibility to do processing on a HPC environment, where task managing and resource allocation are controlled by SLURM batch job system. However, I have not found the right configurations how to utilize the allocated resources within R efficiently. I have tried to allocate 20 CPU's to one task in SLURM, using plan(multicore) -function of future package in R. After running test runs with different count of CPUs allocated, efficiency statistics suggested that with these settings only one of the CPU's allocated was used during the test runs.
Slurm bash script presented below
...ANSWER
Answered 2020-Nov-17 at 08:24Issue was found by HPC service provider. For unknown reason OMP_PLACES=cores
variable which should tie threads/processes to specific cores, appeared to bind all processes to a single core only when running multi-core R jobs. Issue has been solved by rebuilding r-environment singularity-container.
QUESTION
Is there a way to change the projection (like st_transform
from sf
package) of LiDAR point cloud while remaining in R?
With lidR
package you can set but not modify the point cloud projection. I know las2las from lastools could do the job (and this part is open) but I would like to keep it simple, within R and without hard copying the input/output of this process.
Any advice?
...ANSWER
Answered 2020-Sep-27 at 00:48This question has already been answered on gis.stackexchange. In short you can use spTransform
on a LAS object but it is recommended to used las2las
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install lidR
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page