Questions tagged [lidr]

R package for Airborne LiDAR Data Manipulation and Visualization in Forestry Applications

Filter by
Sorted by
Tagged with
0 votes
1 answer
13 views

How to export result of point_metrics() in lidR?

I have las files along coastal areas which include multiple flights. Usually I use both water and ground when normalizing but this data has 2 things to overcome. The first has ground at a lower level ...
user avatar
  • 427
1 vote
1 answer
21 views

grid_canopy() fails when chunk has 1 veg return

grid_canopy() fails in catalog_apply() when chunk has only 1 vegetation return. (In the case of this file (see code), not dropping the overlap will allow the script to complete, but I don't think this ...
user avatar
  • 427
1 vote
0 answers
50 views

pixel_metrics - compute selected metrics only

Below is the code to compute all standard metrics from R package lidR. library(lidR) x <- pixel_metrics(las_catalog, .stdmetrics, res = 30) I want to compute only few pixel metrics only, like : ...
user avatar
0 votes
1 answer
81 views

Error with certain las functions in lidR including decimate_las

I am trying to work with a las file from photogrammetry that is one tile from a retiled lascatalog. The las (v1.2) file is linked below. My issue occurs with other tiles too. I can load the file using ...
user avatar
0 votes
0 answers
42 views

Could not find function "rasterize_terrain"

I'm new to R so forgive me if this is obvious. I'm using lidR to create a dtm of a single laz file via kriging and whenever I put in the function dtm<-rasterize_terrain(las, algorithm = kriging(k=...
user avatar
  • 1
1 vote
1 answer
25 views

lidR: LAScatalog clip_roi using shapefile attribute as filename

I am trying to use the LAScatalog engine and clip out several thousand point clouds using a shapefile. I have already run this successfully but I specified my output names using {XCENTER}_{YCENTER} ...
user avatar
3 votes
1 answer
33 views

Filter classifications above 31

I am processing a bathymetric lidar dataset, where underwater points are classified as "40". The full las file shows these: las_all <- readLAS("s08160w08700.las") unique(las_all$...
user avatar
  • 33
2 votes
1 answer
47 views

incompatible Point Data Format ID

I’m working on an area covered by two datasets, one from 2010 and the other from 2015. The former was provided as XYZ divided into ground, nonground and vegetation. So I read the files, merged them ...
user avatar
  • 133
3 votes
2 answers
52 views

Lines and pixels in DTM

I'm creating DTM from lidar data using lidR. I get vertical lines and a pixelated appearence in some areas. I've tried different algorithms (knnidw and tin). library(lidR) fil = '/home/bera/GIS/...
user avatar
  • 51.3k
0 votes
1 answer
168 views

lidR installation

I'm trying to install R and lidR on Debian 11: Installed r-base-dev v 4.0.4-1 using Synaptics Starting R in terminal, and: install.packages("lidR", dependencies=TRUE) The install process ...
user avatar
  • 51.3k
2 votes
2 answers
78 views

Select option on a LAScatalog lidR with catalog_retile

I'm tying to load a catalog and simply re-export the same tiling, but only with xyz attributes, whatever attributes are found in my original list of LiDAR tiles. Here the code I use : library(lidR) ...
user avatar
  • 73
2 votes
1 answer
54 views

Change extent of lidR LAS object for raster alignment?

Is it possible/allowed to change the extent of a lidR LAS point cloud? And if yes, does it affect the generation of rasters (e.g. with grid_metrics or grid_canopy), so that they cover the full extent? ...
user avatar
  • 1,221
0 votes
1 answer
56 views

Ideal procedure to deal with faulty data for generation of LiDAR trajectory [closed]

The reason for this post is to understand possible remedial measures when one is dealing with a lidar dataset that is faulty (incorrectly populated, missing trajectory information etc.). Obviously, re-...
user avatar
  • 155
1 vote
1 answer
66 views

What is the lidR filter_poi() equivalent to readLAS(..., "-keep_last")?

With the excellent lidR package we can filter at C++ level when using readLAS(), e.g. with the following syntax lidar = readLAS(LASfile, filter="-keep_first") or when the pointcloud is ...
user avatar
  • 1,221
1 vote
1 answer
52 views

How to get las Zref values after normalization in lidR?

I understand that normalize_height() in lidR creates a Zref attribute so that it can be unnormalized. While I can print Z for the normalized file, I cannot print Zref. Subsequently, when I apply ...
user avatar
  • 427
1 vote
1 answer
25 views

Pattern matching with lidR's LAS Catalog

Pattern matching can be used to read specific tiles with readLAScatalog. For example: (als <- readLAScatalog(here("als/2normalized/voxels"), pattern="*.10m.laz")) However, can &...
user avatar
  • 1,217
0 votes
1 answer
62 views

Output lidR li2012 tree segmentation

I am trying to output the result of li2012 tree segmentation but can't seem to write the new attribute in the original las file or into a new file. This is the code I have: las = readLAS("path/to/...
user avatar
  • 685
2 votes
1 answer
62 views

Why do lidR and LAStools report different point densities?

Why do lidR and LAStools report different point densities? For a .las that I have here. Both report number of points correctly at 12500 pts. The CRS is set and both also report it correctly. But for ...
user avatar
  • 205
1 vote
1 answer
41 views

LAS catalog not loading - Error in sp::SpatialPolygons

I am getting this error that I have never received before. I have tried loading data in the catalog format with multiple LiDAR files including the Megaplot.laz data built into the lidR package. ...
user avatar
1 vote
1 answer
53 views

Manually add points to a LAS object with lidR

Using lidR, given a LAS object, read from a LAS file: las <- readLAS(point_cloud_file) and points (extracted from a shapefile): shp <- st_read(shp_file) pts <- st_coordinates(shp) I would ...
user avatar
  • 73
1 vote
1 answer
151 views

How to assign/project las-file using R?

I have got a LAS file from a MLS, which has following specifications: test <- lidR::readLAS("<file.las>") print(test) #> class : LAS (v1.0 format 1) #> memory : ...
user avatar
  • 143
1 vote
1 answer
37 views

How to filter all but last returns using lidR?

I am using the great lidR package and want to check all points classified as ground which are not the last returns. How would I do that? Something like this would this would be logic for me but its ...
user avatar
0 votes
0 answers
65 views

Problem using lidR functions on Mac

I have been going through LiDAR processing tutorials for R Studio and was successfully able to get through this one by NEON about 4-5 months ago: https://www.neonscience.org/resources/learning-hub/...
user avatar
  • 1
1 vote
1 answer
90 views

Fix point cloud lidR - normalize_height fails

I'm working on an airborne lidar survey of around a thousand tiles (500m * 500m) using LAScatalog with lidR. I firstly ran a las_check()... No issues reported: las_check(CTG_Bertrix) #> Checking ...
user avatar
  • 427
1 vote
1 answer
90 views

Efficiently write LiDAR data to CSV with data.table::fwrite

I have a LiDAR file (.las) that I ran through my R function: writelas2csv <- function(x,y) { lasinspatpt <- list(as.spatial(readLAS(x))) write.csv(lasinspatpt, y, row.names = T) } but as we ...
user avatar
  • 13
0 votes
1 answer
22 views

lidR: las_check deep = T failed while deep = F succeeds

I want to run some test on a LAScatalog object using las_check with lidR in R. The first run worked just fine (all flags were green) and when I tried to run the same las_check(ctg_bertrix, deep = T), ...
user avatar
  • 427
1 vote
2 answers
110 views

LiDAR with treeID exported to csv

I have used the lidR package in R to run a point cloud segmentation of trees using the li2012 algorithm. I am interested in exporting my results to a csv file, but the methods I have tried did not ...
user avatar
1 vote
1 answer
43 views

Retrieve file names with catalog apply and las catalog

I'm using catalog_apply with a las catalog to compute some simple cloud metrics, which returns a list. The following code, for example, will process 45 point clouds and return a list of 45 items. But ...
user avatar
  • 1,217
2 votes
1 answer
80 views

lidR classify by shapefile (merge_spatial) issues with user defined function

I have successfully classified buildings via a buildings shapefile input for a single las file but I am having trouble with making a function to use this feature in the catalog format. Here is the ...
user avatar
1 vote
1 answer
45 views

Using lidR to calculate the number of null voxels

I have a number of LAS files (750+). I am using the package lidR to extract different metrics. I am using the following function to calculate the number of voxels in each files that contain a LiDAR ...
user avatar
1 vote
1 answer
63 views

Select multiple points closest to a set of coordinates

Given a LAS object with x,y,z coordinates, i.e LASfile <- system.file("extdata", "Megaplot.laz", package="lidR") las = readLAS(LASfile, select = "xyz") and ...
user avatar
2 votes
1 answer
134 views

lidR classify powerlines features which are misclassified as noise

I am using NOAA LiDAR data to experiment with methods in lidR. I want to use the linear segment_shapes() function to locate powerlines, but some of powerlines are already classified as noise. Using ...
user avatar
1 vote
1 answer
59 views

Overlapping (duplicate) ALS tiles

Related to this question: Overlapping LAS tiles, but none of the answers explicitly addressed my issue. I have overlapping ALS tiles, but not from 'duplicate' files. The tiles overlap because of ...
user avatar
  • 1,217
1 vote
1 answer
34 views

Keep track of plot name when using a LAScatalog for tree detection

I'm using LAScatalog with an area based approach for tree detection. Ultimately, I want to merge the trees and tree height information into a single data frame for subsequent analysis. But I did not ...
user avatar
  • 1,217
2 votes
1 answer
97 views

Calculating Leaf Area Density for different vegetation types based on height conditions

The LAD function in lidR is used to calculate the Leaf Area Density. This can be done as shown below. Now, how can I calculate LAD out of a LAS file for different vegetation types based on height ...
user avatar
0 votes
0 answers
45 views

Point Cloud Z attribute not getting rendered by rayshader

I am having some problem with properly plotting the Z values from the LAS file as mentioned here. I am using the latest development version of lidR and the latest version of rayshader available from ...
user avatar
2 votes
1 answer
76 views

Export classification LiDAR to raster

I'd like to export the LiDAR data according to their classification in a georeferenced raster format. Something that look like that: Here is the code that I tested to retrieve the classification: ...
user avatar
2 votes
1 answer
248 views

LiDAR 3D modeling using package rayshader and LAS file in R

The rayshader package in R allows beautiful 3D modeling in R. Now I was trying to first try and overlay a LAS file on top of a base-map which is a Rayshader array object. I was trying %>% to link ...
user avatar
2 votes
1 answer
49 views

Adding RGB attributes to voxel

How can I add the RGB attributes to a voxel object? The idea is to give RGB to the colorargument inside the plot function in lidR. And still have the attribute Z as the legend in the RGLwindow. The ...
user avatar
1 vote
1 answer
100 views

lidR delineate crown spatial polygon error

While using the delineate_crown function to delineate crowns, I get a spatial polygon error. How can this be fixed? # Bring in the ALS file TP1 = readLAS("~/Sample.las") # Then, normalize ...
user avatar
1 vote
2 answers
103 views

Add voxel attributes to LAS point cloud

I would like to add data from voxels to a point cloud. Imagine I calculated some voxel statistics with voxel_metrics(), for example: voxels <- voxel_metrics(las, length(X), res=0.1, all_voxels=TRUE)...
user avatar
  • 421
1 vote
1 answer
30 views

Is the grid_terrain resolution in the units of the point cloud?

My las tiles are all in a coordinate system that uses US feet, so if the res parameter for grid_terrain() is set to 1, is the output 1-ft resolution? I figured this is the case, but my professor ...
user avatar
  • 21
-1 votes
2 answers
150 views

Alternatives to LAStools lasthin?

I have a classified LAS file that I would like to further filter the ground points to only include the lowest z values based on a variety of grid sizes. Is there an alternative tool available that ...
user avatar
1 vote
1 answer
51 views

Can catalog_apply output a LAScatalog?

I am trying to use catalog_apply on a LAScatalog of 151 las tiles for my research. I have experimented with a catalog of 10 of these tiles, and with automerge = TRUE, the catalog_apply returns a huge ...
user avatar
  • 21
1 vote
1 answer
39 views

lidR: center chunks when retiling

I want to retile big TLS files into quite small chunks of maximum 20 m x 20 m size. I have to normalize the point cloud, thus I need to classify the points and create a DTM for each tile. For this ...
user avatar
  • 421
0 votes
0 answers
105 views

leafR error: no applicable method for 'readLAS' applied to an object of class "c('LAS', 'Spatial')

First, I read a LAS file into R using the readLAS() function from the lidR package: test_las <-readLAS("C:/Users/LAS files/file.las") I am now attempting to use functions from the leafR ...
user avatar
  • 45
6 votes
1 answer
122 views

Calculating grid_metrics() in a loop, using column name within variable

I want to calculate grid_metrics() for several fields of my point cloud, using several functions. I want to perform this in loops to make my code look cleaner. Basically I want this: # loop through ...
user avatar
  • 421
2 votes
1 answer
95 views

R lidR package grid_terrain() giving weird plot

I am working on the pre and post lidar earthquake data from Kumamoto, Japan. I would like to generate a DTM with the grid_terrain(pre_online, res = 1, algorithm = knnidw(k = 10L, p = 0.5)) function in ...
user avatar
4 votes
1 answer
125 views

Get eigenvalues of large point cloud using lidR

I have some very big TLS point clouds (up to 400 million points) and want to assign the eigenvalues to each point in order to later calculate geometric features like planarity or sphericity. I use R ...
user avatar
  • 421
1 vote
1 answer
91 views

Crown area calculation with lidR::.stdmetrics differs from raster::area

I found out that tree crowns delineation using lidR::.stdmetrics calculates an area that is different from the area calculated by raster::area() or QGIS with the field calculator $area function. The ...
user avatar

1
2 3 4 5