Quantcast
Channel: User JRR - Stack Overflow
Browsing latest articles
Browse All 50 View Live

Comment by JRR on lidr LAScatalog manual classification

The filter commands are from LASlib that is used internally to read and write LAS files

View Article


Comment by JRR on How to homogenize points using lidR to reduce streaking...

Your code looks correct. How did you build the density map? I do not understand the density map you produced. I see densities ranging from 0 to 15 which mean that the decimation failed? Please be more...

View Article


Comment by JRR on Is the order of an unordered map always the same for a...

the key is an int in this case

View Article

Comment by JRR on Is the order of an unordered map always the same for a...

Assuming that I'm using my own hash. Would the order be the same for each compiler?

View Article

Comment by JRR on lidR calculation or Rumple Index from points failing (and...

Does it fails with all dataset or only your dataset? in the first case please make a reproducible example including data.

View Article


Comment by JRR on Manually load large raster to perform lidR::locate_trees()

If you think your raster can fit in memory you can simply multiply by 1. canopy = canopy*1

View Article

Answer by JRR for How to get a circular subset of a las-dataset with specific...

I can reproduce your issue with example dataLASfile <- system.file("extdata", "Megaplot.laz", package="lidR")las = lidR::readLAS(LASfile)las_ctpt <-...

View Article

Answer by JRR for How to convert lidar format las to data.frame?

If you do not want to play with lidR and want to use bare bone data.frame simply use rlas instead of lidR.library(rlas)read.las("C:/1/078-638.las")

View Article


QNetworkAccessManager does not work on windows with https

I'm trying to download files from a https url with my application using the following code in Qt5. This works perfectly as I want on Linux but with the Windows version content is always empty and...

View Article


Answer by JRR for QNetworkAccessManager does not work on windows with https

It took me literally an entire day to figure out how to make it working. I eventually found the answer here.In Qt maintenance tool select Qt > Developer and Designer Tools > OpenSSL 1.1.x Toolkit...

View Article

Answer by JRR for TIN DSM Algorithm used in LidR package R

lidR 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...

View Article

Answer by JRR for How to read many lidar files (.las) at once and combine...

No need to loop. rlas already natively support reading multiples filesrlas::read.las(filenames)

View Article

Answer by JRR for How to solve Error at lidR::delineate_crowns?

I tested both with delineate_crown() (deprecated) and crown_metrics(). Both work. delineate_crown() produces warnings but they can be ignored.library(lidR)so_sample_las <-...

View Article


Answer by JRR for Is there a way to plot the ''true'' coordinates on the x...

This is documented in plotclear_artifacts logical. It is a known and documented issue that the 3D visualisation with rgl displays artifacts. The points look aligned and/or regularly spaced in some view...

View Article

Answer by JRR for How to bring las/laz-file to user defined point density...

You want to reach a density expressed in pts/m² by decimating/voxelizing in 3D. It don't think it is even possible. If you want to reach 4 pts/m² use decimate_points() which is designed for such...

View Article


Answer by JRR for R rgl lidR slow rendering on Windows 11 64 bit

rgl has trouble displaying too many points. The plot function in lidR is convenient and allows to produce ready to publish illustrations but cannot replace a real point cloud viewer for big point...

View Article

Answer by JRR for How to fix notes in R package about mispelled words and...

The first note is not a problem and is very unlikely be the reason for submission rejection. The second one however is likely to be a problem. Examples must run fast. You must reduce the amount of data...

View Article


Answer by JRR for Extract data from an object from lidar data in r

You can aggregate the data.tablelas@data[, length(X), by = treeID]

View Article

Answer by JRR for Subscript out of bounds error with custom function in...

You missed to propagate dtm_rasoutput<-catalog_apply(las, raster_metrics, dtm_ras = dtm_ras, grid_size=grid_size, sensitivity=sensitivity, .options=options)You used incorrect package to cropbbox...

View Article

Answer by JRR for Error: Invalid function provided as algorithm while using...

ForestTools::mcws is a function from the package ForestTools and is not designed to be compatible with lidR. lidR cannot accept any function as input and the developers must respect some convention to...

View Article

Answer by JRR for Is there an R function for finding if a .LAZ file is...

Something like that (did not test)library(lidR)library(sf)ctg = readLAScatalog("/path/to/folder")extent = st_read("/path/to/folder/filname.shp")ctg2 = catalog_intersect(ctg, extent)ctg2$filename

View Article


gcc-8 -Wstringop-truncation what is the good practice?

GCC 8 added a -Wstringop-truncation warning. From https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82944 :The -Wstringop-truncation warning added in GCC 8.0 via r254630 for bug 81117 is specifically...

View Article


How to make QTextCursor::WordUnderCursor include more characters or larger words

I'm trying to show a tooltip when the cursor is over a keyword in a text editor using:QTextCursor cursor = cursorForPosition(pos);cursor.select(QTextCursor::WordUnderCursor);This works well but the...

View Article

Answer by JRR for Trouble reading LAZ lidar files in R download from NOAA DAV

lidR uses LASlib/LASzip from LAStools to read and write LAS and LAZ files. Your files are corrupted. Story ends here. You must find non-corrupted files, or you must try to reproduce with LAStools...

View Article

Answer by JRR for Why am I having issues plotting LAS with...

Use lidR::plot(las,size=5,pal=grDevices::terrain.colors, axis=TRUE)

View Article


Answer by JRR for building R packages to use ASAN

This the document I wrote for myself and that I used myself.Download and decrompress R source codeInstall the compiler clang. apt-get install clang should do the jobOpen config.site and add the...

View Article

Answer by JRR for Calculating Point-Based EigenVectors from a LAS file in Lidr R

Use C++The documentation of point_metrics explicitly mention to use C++ code in this case. It gives you an example you can copy and paste changing only the output variableRcpp::sourceCpp(code =...

View Article

Answer by JRR for Disable OpenMP for code coverage of an R package on Github...

I found a third option. I'm running the coverage on macOS instead of Linux because it has no native support of OpenMP.

View Article

Disable OpenMP for code coverage of an R package on Github actions

I have an R package with C++ code and I'm using GitHub actions to run unit tests and code coverage with covr. Everything is working.However, code coverage does not work with parallelized blocks of C++...

View Article



Comment by JRR on Lack of precision when using the lidr package's...

Share your data otherwise there is no way to help you

View Article

Answer by JRR for Lack of precision when using the lidr package's...

The mistake you made was to compute the local maxima from the point cloud and then use these maxima as seed on a raster that was modified with a focal function. The local maxima of the raster no longer...

View Article

Answer by JRR for Attempting to Calculate Leaf Area Index in lidR package...

throws error that Duplicate elements are found and at least one metric was not a number out<-log(nveg+1/(nground+1))*cos((ScanAngle*pi/180)/0.5) return(list(LAI=out))Here, clearly LAI is not a...

View Article

Comment by JRR on Are there any risks to accessing internal functions with ::...

> but I don't think CRAN will be sympathetic to that special case This case it actually allowed by CRAN and it is the only case

View Article


Answer by JRR for How to remove duplicate las points with same XYZ but...

Copy the code of lidR::filter_duplicated() and use fromLastdup_xyz <- duplicated(las@data, by = c("X", "Y", "Z"), fromLast=TRUE)las = las[!dup_xyz]

View Article

Answer by JRR for assigning the coordinate system to my las catalog and my...

EPSG:4326 is a longitude/latitude CRS. Your point cloud is in a projected CRS. The error comes from the terra package when trying to build a raster in long/lat with invalid projected coordinated

View Article

Comment by JRR on Unable to read chunk in lidR catalog_apply

terra also defines is.empty. Maybe there is a clash in namespace. Did you try lidR::is.empty()?

View Article


Comment by JRR on lidR lascatalog processing engine transformation outputs...

sf does not have st_transform for LAS objects from the lidR package. The lidR inherit its own function st_transform and because of some inheritance rules it must be call thought sf::st_transform. The...

View Article


Answer by JRR for lidR lascatalog processing engine transformation outputs...

sf does not have st_transform for LAS objects from the lidR package. The lidRversion inherits its own functionst_transformand because of some inheritance rules it must be call thoughtsf::st_transform....

View Article
Browsing latest articles
Browse All 50 View Live


Latest Images