Skip to main content

Questions tagged [lidr]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
29 views

Adding WKT to VRT using R / LidR

I am trying to work through this error after adding a VLR to a LAS. I'm using a custom local projection that does not have an EPSG code, hence trying to add the WKT string as a VRT. > header(las) ...
Summitbri's user avatar
0 votes
1 answer
39 views

Partially processing a catalog with a polygon in lidR

I'm trying to modify/update the code in this answer (Partially processing a catalog with an extent in lidR), in order to partially process a catalog with a polygon (e.g., to pick up after a computer ...
Ray J's user avatar
  • 541
2 votes
1 answer
42 views

Rectangular Clipped Segments

I am trying to create four separate clipped quadrants to my full .laz file (See Figure 01). I was able to clip one quadrant of (number 03 in figure 01), but am struggling to identify points to clip ...
Hunter Moore's user avatar
0 votes
1 answer
52 views

Counting number of points per feature unique Id in lidR

I am working with a LAScatalog comprising over 10 LAS files and have generated a fishnet grid with 1m x 1m cells upto the extent of my ROI. Each cell in the ROI grid is uniquely identified by an 'Id' ...
Sonali Sharma's user avatar
1 vote
1 answer
32 views

DTM is generated is not the same size as the input LAS file

This is an extension of this question: How to remove buffer from DTM TIFF using Catalog When I generate a DTM using the following code (or any of the code provided in the above linked question), I get ...
nola's user avatar
  • 89
0 votes
2 answers
37 views

How to remove buffer from DTM TIFF using Catalog

I have 1300 LAS files and need to generate DTM's with a single TIFF output for each LAS file and I am wondering how I can remove the chunk buffer for the output TIFF files. I have this code that works ...
nola's user avatar
  • 89
2 votes
0 answers
41 views

Updating LAS Classification: Correcting Misclassified Vegetation Points

I have two las files: abc and xyz. The LASGROUND class in abc have some misclassified vegetation points while the xyz have those correctly classified vegetation points. Now I want to update the ...
Sonali Sharma's user avatar
0 votes
1 answer
36 views

Difficulty displaying custom LAS attribute in ArcGIS Pro symbology

I have computed a vegetation index for my point clouds and have added it as a new attribute to my LAS file, and saved the updated las file using the following code- lz <- readLAS('x.laz') rgb <- ...
Sonali Sharma's user avatar
0 votes
0 answers
17 views

LidR error "Error: [writeRaster] file exists. You can use 'overwrite=TRUE' to overwrite it" when rasterising canopy height model [duplicate]

I am currently using the LidR package to rasterize a canopy height model from a LAScatalog object: opt_output_files(ctg_norm) <- paste0("C:/Programming/C_Forstenried/las_outputs/temp/{*}chm&...
Merlijn Dingemanse's user avatar
1 vote
1 answer
37 views

Is there a variable crown radius for li2012 in lidR?

I'm trying to implement a variable crown radius search using li2012 for segmentation of the point cloud in lidR. I've been following the steps in The lidR package and in section 7.2.3 would like to ...
Walshe_d's user avatar
  • 729
0 votes
1 answer
116 views

lidR: Writing output from pixel_metrics() from "multiple-output-function" to separate raster files

First some background from the original question: I'm using the lidR package to make rasters of metrics calculated on point clouds. I have a custom function that calculates 9 metrics outputed as a ...
Martin Stjernman's user avatar
0 votes
1 answer
47 views

How to plot tree tops and point cloud data in the same window using lidRviewer?

I'm following the steps in The lidRbook Chapter 7.1 to get tree tops. I want to plot the tree tops and point cloud data as illustrated in the book, however, I want to use lidRviewer as it runs much ...
Walshe_d's user avatar
  • 729
-2 votes
1 answer
192 views

Determine tree age

According to Measuring Trees: The girth of a tree can be used to estimate its age, as roughly a tree will increase it's girth by 2.5cm in a year. So, simply measure around the trunk of the tree (the ...
Arthur_Morgan's user avatar
0 votes
0 answers
26 views

ArcGIS Pro 3.1 errors out on lidR sf object Hulls exported as a polygon shapefile

So I am trying to write a Hulls object created from the crown_metrics function to a shapefile using st_write. Now, with st_write to resolve the 3D error in regards to a shapefile, I first used st_zm. ...
Arthur_Morgan's user avatar
0 votes
0 answers
46 views

plot lidR Hull object with geom_sf with a basemap

So I am trying to create a static map by overlaying the tree canopy hulls (created using crown_metrics function) as hollow polygons with yellow color on a ESRI basemap. How can I resolve the error? I ...
Arthur_Morgan's user avatar
1 vote
2 answers
136 views

How to export an IDW DTM as a GeoTIFF file in R

I have loaded both raster and lidR packages within RStudio and I am trying to export the IDW DTM files but have been receiving errors about 'format'. I have exported a TIN DTM already however with IDW ...
Niall Gavin's user avatar
1 vote
1 answer
95 views

lidR canopy height map has holes/jagged edges

I am trying to create a canopy height map from LIDAR point cloud data (LAS format) but I get some jagged edges/holes in my results (see photo). Is there a parameter I can tweak to fill these in? I ...
Max Ogden's user avatar
  • 152
0 votes
1 answer
63 views

Normalizing LAScatalog only outputs one tile

I'm having trouble normalizing a LAScatalog. I wonder whether my methodology is flawed, or if something is possibly wrong with my dataset (a point cloud based on photogrammetry). When I try to ...
NateDogg123's user avatar
1 vote
1 answer
40 views

How to fill pits for a DEM/CHM when using the LAScatalog engine?

I'm trying to create a DEM/CHM using the LAScatalog engine. I've followed the steps in the lidRbook. In chapter 6 section 6.4 the post processing fills in areas no missing values for single las files ...
Walshe_d's user avatar
  • 729
0 votes
0 answers
53 views

Create a buffer on a single LAS file using lidR

I want to create a buffer for a single LAS file in order to test different algorithims for DTM creation on a small scale before scaling up to all my files using LAScatalog. I know LAScatalog creates a ...
Walshe_d's user avatar
  • 729
0 votes
1 answer
40 views

lidR pixel_metrics returning incorrect results with LAScatalog [closed]

This code seems to work correctly when I use it with a single las file f <- function(x) { # user-defined fucntion list(mean = mean(x), sd = sd(x)) } las <- readLAS(<path to las file>) ...
Sam H's user avatar
  • 1
0 votes
0 answers
21 views

Interactively re-center a lidR plot

Is it possible to move the plot center of a lidR plot from within the plot visualization? For example, I try dragging and using up and down arrows, but it does not move the point cloud's position ...
ENIAC-6's user avatar
  • 906
0 votes
1 answer
40 views

R LidR Package readlas function with extra features limitations

I'm encountering an issue while working with LAS data generated from the open-source software CloudCompare. I've exported 24 geometric features to a LAS file format(1.4), and I'm experiencing ...
Muzo583's user avatar
  • 61
0 votes
1 answer
65 views

How to calculate voxel metrics for a LAScatalog using lidR?

I'm trying to calculate metrics for a LAScatalog with the voxel_metrics function. This is the code I used: library(lidR) ctg <- readLAScatalog("laspath") voxel_metrics(ctg, ~mean(Z), 4) ...
user232510's user avatar
0 votes
1 answer
154 views

lidR producing error "$ operator not definied for this S4 class" when trying to apply function to lascatalog using catalog_apply

I am trying to write a function to calculate specific metrics which I can write to a data frame and then a .csv file to write 'reports' on each las file in a directory. I have tried the following code:...
Dr-JH-o'clock's user avatar
0 votes
0 answers
38 views

Can Z output from rasterize_terrain() be made numeric?

I'm updating code to compute height and elevation of tree tops derived from locate_trees(). To do this I also create a DTM from the LAS file. The older grid_terrain() produced a RasterLayer and the ...
Ray J's user avatar
  • 541
0 votes
1 answer
94 views

Iterating through las directory using lidR in R results in not finding file or not recognising file as .las

I am trying to produce a script which has functions that can produce a list of statistics and writes them to data.frame, which can in turn be written to a csv file if needed. This would be to check ...
Dr-JH-o'clock's user avatar
0 votes
1 answer
45 views

How do I use autocrop with a complex function for catalog_apply()?

In the case of a complex function, I would like to try the autocrop option, instead of crop inside the function, to resize output from catalog_apply() to the chunk size. In the code below, the ...
Ray J's user avatar
  • 541
1 vote
1 answer
21 views

How do I use autocrop in a function for catalog_apply()?

I would like to try the autocrop option, instead of crop inside the function, to resize output from catalog_apply() to the chunk size. In the code below, the commented-out code works, but the autocrop ...
Ray J's user avatar
  • 541
0 votes
1 answer
49 views

Plotting real (normalized) las values on dtm

I am trying to plot a las where I filtered objects, that have a first and a last return simultaneously (objects in the las file), onto a created dtm of the same las. I am able to produce a good result....
utz's user avatar
  • 3
0 votes
1 answer
55 views

lidR: What is "Area" in Cloud_metrics(.stdmetrics)? [closed]

I have plot locations and .las tiles. I have extracted the point clouds at each of the plots with a 15 meters radius. It means i now have as many .las files as i have plots. Then, in a for loop, for ...
Renaud Bied-charreton's user avatar
0 votes
0 answers
29 views

LAS files not identified in lidR

When I try to upload the las file to work on lidR package it give the following error. The code I used to upload the file las <-readLAS("<Sample.las>") Error in streamLAS.character(...
Dilshan Benaragama's user avatar
2 votes
1 answer
129 views

Overwriting files in function pixel_metrics()

I'm trying to test my pixel_metrics() custom function, and I'm not sure how to overwrite the old file, like the error message suggests in the screenshot. I have added overwrite=TRUE to my function ...
NateDogg123's user avatar
3 votes
1 answer
109 views

How do I run filter_poi() on a LAScatalog object?

I want to read a LAS catalog, create a DEM, normalize the catalog, and run filter_poi() on the catalog. My issue is that when I try to run filter_poi(), in the code below, I get the error "...
NateDogg123's user avatar
1 vote
1 answer
208 views

How can I export a lidR LAScatalog to a shapefile?

I would like to export a lascatalog to a shapefile. It could be done in the past with rgdal but this is being retired. The error is below. library(lidR) library(sf) ctg <- readLAScatalog(system....
Ray J's user avatar
  • 541
3 votes
1 answer
154 views

Classify vegetation by height

Trying to further classify a las catalog that already has buildings, bridges, noise and ground classified. I want to break the unassigned points into vegetation classes by height but can't get it to ...
pseudotsuga's user avatar
1 vote
1 answer
47 views

Create LAS v1.4 from scratch

I want to create a LAS object from scratch with number of returns up to 15 (according to LAS v1.4) like: data <- data.frame(X = runif(100, 0, 100), Y = runif(100, 0, 100), ...
BenBrede's user avatar
0 votes
0 answers
20 views

rasterize_terrain DTM raster file write error [duplicate]

I am trying to create DTM rasters from a list of LAS files. Code: # Create a LAS catalog LAS_List = readLAScatalog("path", recursive = TRUE) # Create an output destination to store the DTM ...
Arthur_Morgan's user avatar
0 votes
1 answer
141 views

Create one single DTM raster file from multiple LAS files

This question can be considered an extension of Create a DTM using the TIN algorithm I am providing multiple LAS files as a catalog list to the rasterize_terrain which breaks the LAS into smaller ...
Arthur_Morgan's user avatar
0 votes
0 answers
46 views

Unexpected artifacts when creating a digital terrain model (DTM) using lidR and gstat libraries in R

I'm using the lidR, raster, sp, and gstat libraries in R to create a Digital Terrain Model (DTM) from LiDAR data. I'm encountering unexpected artifacts in my DTM and I'm unsure why. Here is my code: ...
Purple_Ad's user avatar
1 vote
1 answer
93 views

Create a DTM using the TIN algorithm

I am trying to create a DTM on a county wide level (so using LAS catalog). The lidRworkbook advises to use a buffer when using the TIN method, however the workbook doesn't show how to do that. So how ...
Arthur_Morgan's user avatar
2 votes
1 answer
114 views

Calculate proportions of all returns, returns between a height interval

I want to calculate, for each pixel, the proportions of returns between 0.5 and 5 m height above ground, compared to the total return count I have figured out how to do it for the entire las file, but ...
Bera's user avatar
  • 74.9k
2 votes
2 answers
387 views

How can I crop a raster (within a function) that is used by catalog_apply() in lidR, using Terra instead of Raster?

I have older code to crop a chunk within a function (to avoid edge effects when later merging CHM tiles together (i.e., edge pixels derived without enough data. The extend of 1 is to avoid little gaps)...
Ray J's user avatar
  • 541
1 vote
1 answer
52 views

Classify Pointcloud using thematic layer with lidR

I want to use lidR to classify points within a point cloud using a few thematic shapefiles. This includes buildings, vegetation and cars. For this I use the classify_poi function, which works for ...
FelixB.'s user avatar
  • 109
1 vote
1 answer
35 views

How to harmonize catalog to target density

My original catalog: has a mean density of 2.2 points/m2, but some areas have a higher density. : > plot(lidR::grid_density(ctg, 1), main = "Density grid 1x1 m ", breaks = c(0,2,3,5,16), ...
candelas762's user avatar
2 votes
1 answer
96 views

negative or null values in custom function

I'm working with the package lidR (v 4.0.3) to extract the tree positions using a custom function but it behaves weirdly. If I use the following, I get an error: f = function(x) { 0.413 * x^0.5532 } ...
Nico's user avatar
  • 305
0 votes
0 answers
58 views

Why clip_roi function in lidR only work with SpatialPolygons and not SpatVector?

Most of the functions from lidR work using SpatVector and SpatRaster from terra package but I obtained this error using clip_roi function Error in clip_roi(ctg, Extent1) : Geometry type SpatVector not ...
Juan Guerra's user avatar
0 votes
1 answer
54 views

lidR, create table with numberofreturn by returnnumber in catalog

In a LAScatalog we can have the 5th first return, but how can i have this table if there is 7 return like this : With this code i can generate this table with 4 return : LASfile <- system.file(&...
Pascal Obstétar's user avatar
2 votes
1 answer
60 views

Memory efficient way of using clip_roi for bigger areas

I am trying to clip LAS files from a LAScatalog object based on a polygon boundary (sf object). However, since the area of interest is too big, the clip_roi function might eventually like mid way ...
Arthur_Morgan's user avatar
2 votes
1 answer
74 views

clip_roi dimension error

I am trying to clip LAS files from a catalog object based on a Polygon boundary (sf_object), however, I am getting the following error. What could be the issue and how can it be fixed? Error: ...
Arthur_Morgan's user avatar

1
2 3 4 5
7