Questions tagged [lidr]

lidR: Airborne LiDAR Data Manipulation and Visualization for Forestry Applications

Filter by
Sorted by
Tagged with
2
votes
1answer
29 views

lidR: no slot of name “header” for this object of class “LAScatalog” [duplicate]

edit: This question does share an answer with an existing question, and the problem is the same: lastrees() does not work on LAScatalogs. However, I'm going to leave this question up, because I think ...
2
votes
2answers
45 views

writeLAS writes corrupted file: 'end-of-file' after 10468 of 10474 points

I am seeing strange write behavior with lidR. The outputs from lidR are compressed to fall on a single line. I vaguely recall discussing this with JR before, but cannot recall a solution. #ok las0=...
3
votes
0answers
47 views

Maintaining extra data for .laz for use in R and Python?

I am working on releasing a benchmark dataset for trees in RGB + Lidar and I'd like the format to match the most common use cases and packages. I had been intending on proving a tree index using the ...
2
votes
1answer
30 views

Export raster of CHM from lidR

I would like to use lidR to produce canopy height rasters. I was following along in the 'rasterizing perfect CHM' user guide and now I'm wondering how to export this raster to a GeoTiff or .img. In ...
4
votes
1answer
28 views

Using lidR to count number of pulse returns at different intervals?

I am trying to get the number of pulse at different height interval. I have used the lidR package to do this before with the code below but it seems that recent update in the package breaks my code. ...
2
votes
1answer
49 views

Configuring lidR catalog to overwrite raster output (with different extension)?

I have a small issue with configuring the lidR package for parametrizing the extracted raster files with grid_metrics() function. My question is how to set in the catalog options that: be able to ...
3
votes
2answers
91 views

Filtering above ground LiDAR points using a catalog in lidR?

I am analyzing LiDAR data collected two separate years- 2007 and 2015. My analysis is centered around changes in vegetation during this time period. The ultimate goal is to thin the data from the 2015 ...
4
votes
1answer
104 views

How to use lastrees on a catalog with a function requiring a CHM raster?

I'm still fairly new to using LiDAR data and R, so please let me know if this isn't clear. I am using the lidR package to segment individual trees over a large landscape. I have been using the ...
0
votes
1answer
40 views

Does lasfilterdecimate work when homogenizing by pulse?

In R lidR package, when I run lasfilterdecimate with the homogenize option excluding use_pulse = TRUE it works, but when I include use_pulse = TRUE, it does not work. For example, the code below ...
3
votes
1answer
55 views

lidR (rlas) writeLAS changes values from Classification attribute?

I have a point cloud with extra attributes: class : LAS (LASFˇ v1.4) point format : 6 memory : 2 Gb extent :7498400, 7499200, 5779500, 5780000 (xmin, xmax, ymin, ymax) coord. ref. ...
2
votes
1answer
41 views

lidR lasaddextrabytes does not update header

My lidR version is 2.0.2 I am trying to add an extrabyte about treeID that I get from raster (lasmergespatial with vector is super slow). I have a problem with saving that extrabyte to LAS file. I ...
4
votes
1answer
105 views

Configuring lidR catalog to save files with same filename?

I'm trying to learn how to use the options of catalog() within the lidR package in R. I'd like to save directly the processed files, for example, using grid_terrain() function over a catalog and save ...
3
votes
1answer
78 views

Clipping a catalog with lasclipCircle returns “no point found within region of interest”

I'm trying to clip a catalog using lidR (v2.0.1) package. I've tried with lasclipCircle and lasclip. It gives me the error: no point in ROI, but when I'm viewing the shapefile using mapview (I've ...
4
votes
2answers
109 views

Removing noise from point cloud with lidR package

I have unclassified Terrestrial Laser Scanning (TLS) point cloud data which has some noise. Is there a function in the lidR package which can be used to remove noise?
3
votes
1answer
157 views

Exporting crown boundaries from tree segmentation in R?

I am using lidR package to segment my trees using lastrees directly from the points clouds. The function works fine, however I would like to export to vector file the canopy boundaries from ...
3
votes
1answer
59 views

Watershed a catalog RasterStack in place of RasterLayer in lidR?

I want to use watershed with lidR package on a catalog. I paste this command: rep <- "/home/lasfiles" new_ctg <- catalog(rep) lidR:::catalog_laxindex(new_ctg) opt_output_files(new_ctg) <- ...
3
votes
1answer
73 views

Tolerance setting in watershed segmentation(EBimage/lidR) in R

Can anyone here explain to me what the "tol" parameter in the watershed algorithm implemented in the BioConductor package EBImage (and lidR) does? I find the explanation in the EBImage help difficult ...
3
votes
1answer
134 views

Filtering (lasfilter on) huge LiDAR dataset

My dataset is about 8.3 GB after loaded into R environment by using lidR package. Some points which have return number greater than number of returns need to be removed. With a small dataset, I ...
3
votes
1answer
114 views

Interpolating LiDAR intensity images in R?

I'd like to generate 0.5 m intensity images using lidR, but the resulting raster is full of pits. Here's a reproducible example: library(lidR) LASfile <- system.file("extdata", "MixedConifer.laz", ...
3
votes
1answer
176 views

Calculating standard metrics in multiple LiDAR files with lidR 2.0

I am porting my existing code to lidR version 2.0 and would like someone to let me know if I am coding efficiently. My objective is: to process a directory of LAS files normalize las files calculate ...
1
vote
2answers
159 views

File header incorrectly reporting 0 point records in R?

I have a set of 10 LiDAR files that I'm attempting to retile and eventually use to create a Canopy Height model. I'm able to import them as a catalog, however when I go to retile my catalog, I get the ...
2
votes
1answer
67 views

Why a laz file warns: 'return number' greater than 'number of returns' in R?

Reading a laz file with the lidR package in R I have the following warning. What does it means? las = readLAS("chmp15.laz", filter = "-drop_z_below 0") #> Warning message: #> Invalid data: 8895 ...
3
votes
1answer
248 views

Error in reading point cloud data (.las) in R?

I want to generate a DEM using a point cloud (.las) for which I tried reading it in R using rlas, lidR and rLiDAR : readLAS command and none of it seems to work. The LASfile is not being read at all....
3
votes
1answer
87 views

Constructing a function to pass to lidR::grid_metrics

I am attempting to write an R function, as part of a package, that takes a lidar tile (LAS object) and a vector of cut-points defining vertical layers, and returns a RasterStack where each layer has a ...
5
votes
1answer
130 views

How to assign (or project) CRS to LiDAR file in lidR?

Can someone enlighten me if there is a difference between initializing a CRS object using the EPSG code versus just the +proj string read from a shapefile? Consider the following objects: A ...
3
votes
2answers
482 views

Clipping object of class LAS with polygon shapefile using lidR?

I want to make a simple clip with my .las 3D-Pointcloud. Therefor I use the lasclip() function. Import .las: lidar <- readLAS("~/data.las") lidar gives me class : LAS (LASF v1.2) memory ...
4
votes
2answers
327 views

How to filter point cloud by flightline in R?

The lidR package in R provides a way to mark individual points in a point cloud with a flightline ID by using lasflightline(). From the documentation: Retrieve each individual flightline by ...
2
votes
1answer
99 views

How to incorporate stdmetrics in gridmetrics function?

I am attempting to feed the lidR gridmetrics function a list of metrics. I can generate the list of metrics within a function (following this example): myMetrics = function(z, i) { metrics = list( ...
4
votes
2answers
822 views

How to write the results of lidR grid_metrics to a georeferenced raster?

I'm using the lidR package to calculate LiDAR grid metrics (p.18 documentation) for forestry applications. For example, the following calculates the mean elevation within a 20m cell: library(lidR) ...