Movatterモバイル変換


[0]ホーム

URL:


If you are viewing this file on CRAN, please checkthe latestnews on GitHub where the formatting is also better

lidR v4.2.2 (Release date:2025-11-04)

lidR v4.2.1 (Release date:2025-06-02)

lidR v4.2.0 (Release date:2025-05-25)

v4.2.0 brings new tools for terrestrial data (TLS,MLS):

lidR v4.1.2 (Release date:2024-07-09)

lidR v4.1.1 (Release date:2024-02-03)

lidR v4.1.0 (Release date:2024-01-31)

NEW features

  1. New:point_eigenvalues gained an argumentcoeff to return the principal component coefficients
  2. New functionpitfill_stonge2008(). See references.
  3. NewreadLAScatalog can read a virtual point cloud file(.vpc)

Backward incompatibilities

Following the retirement ofrgdal andsp weremoved the dependence tosp and the strong dependence toraster:

  1. Change: remove functionbbox inherited fromsp
  2. Change: packageraster is now only suggested andlidR no longer depends on it.
  3. Change: the functionextent was removed in consequenceof (3) because it was inherited fromraster and returned anobjectExtent fromraster.
  4. Change: functionscrs,crs<-,projection,projection<-,wktandarea inherited fromraster are nowgeneric. This may create clash with theraster package butanywayraster should no longer be used.

Fixes

lidR v4.0.4 (Release date:2023-09-07)

lidR v4.0.3 (Release date:2023-03-09)

lidR v4.0.2 (Release date:2022-11-28)

lidR v4.0.1 (Release date:2022-05-03)

Changes related to rlas1.6.0

We are currently developing rlas 1.6.0 that uses the ALTREP frameworkto load compact representation of non populated attributes. For exampleUserData is usually populated with zeros (not populated).Yet it takes 32 bits per point to store each 0. With rlas 1.6.0 it willonly uses 644 bits no matter the number of points loaded for nonpopulated attributes. This applies to each attribute populated with asingle repeated value. This allows for saving approximately 30% ofmemory usage depending on the number of non-populated attributes thatare present in the file. rlas 1.6.0 is compatible will all versions oflidR but lidR 4.0.1 introduced some internal optimization, internalfixes and new functions to fully take advantage of rlas 1.6.0. lidRv<= 4.0.0 will work with rlas 1.6.0 but won’t take advantage of thenew compression feature.

  1. the functionLAS() no longer calldata.table::setDT() if the input is already adata.table. Indeeddata.table::setDT()materializes the compressed ALTREP vectors and this is not what we want.One consequence of this change is thatreadLAS() nowpreserve the ALTREPness (i.e. the compression) of the output ofrlas::read.las().

  2. Subsetting aLAS object no longer calldata.table native subset. We previously used something likelas@data[indx] to subset the point cloud. Sadlydata.table tries to materialized the ALTREPed vectorwhenever it can. We implemented internally asmart_subset()function that subset and preserves the compression of the vectors. Oneconsequence of such change is that allfilter_*() andclip_*() functions preserve the compression of thepoint-cloud if any.

  3. las_check() has been slightly modified to ensure itdoes not materialize ALTREPed object. One side effect oflas_check() was to decompress the point cloud unexpectedly.Such a pity! We also changelas_check() to printinformation about the compression.

  4. We changed the way*_metrics() functions evaluatesthe user defined expression because we found that it had the side effectof materializing all the attributes instead of materializing only thoseneeded. For examplepixel_metrics(las, mean(Z)) only needsthe attribute Z. No need to allocate and copy memory forIntensity,ScanAngle and so on. In previousversion all attributes where inspected with the side effect tomaterialize all compressed vectors. The*_metrics()functions now properly detect which attributes are actually necessaryfor the evaluation offunc. Two consequences:(1)*_metrics() functions are 20 to 40% faster, (2) thecompression is preserved if no compressed attribute is used in theevaluation and e.g. pixel_metrics(las, mean(UserData))uncompresses onlyUserData.

  5. New functionslas_is_compressed() that tells whichattributes are compressed andlas_size() that returns thetrue size of aLAS objects taking into account thecompression.las_size() should returns something similar topryr::object_size() but different toobject.size() that is not ALTREP aware. We also changed theprint function so it useslas_size() insteadofobject.size().

On overall lidR’s functions are expected to almost never decompress aLAS object. However other R packages and R functions may do it. Forexampledata.table::print do materializes the ALTREPvectors.base::range() too but notbase::mean() orbase::var().

las@data# Full decompression (print data.table)range(las$Userdata)# Decompression of UserDatalas@data[2, UserData:=1]# Decompression of UserDatalas@data[1:10]# Full decompression

lidR v4.0.0 (Release date:2022-02-17)

rgdal andrgeos will be retired on Jan 1st2024. see twitter(https://twitter.com/RogerBivand/status/1407705212538822656),youtube, or seethe respective package descriptions on CRAN. Packagesraster andsp are based onrgdal/rgeos andlidR was based onraster andsp because it was created beforesf,terra andstars. This meansthat sooner or laterlidR will run into trouble (actuallyit is more or less already the case). Consequently, we modernizedlidR by moving tosf,terra/stars and we are no longer depending onsp andraster (see alsoOlder R SpatialPackage for more insight). It is time for everybody to stop usingsp andraster and to embracesfandstars/terra.

In version 4lidR now no longer usessp, itusessf and it no longer usesraster. It isnow raster agnostic and works transparently with rasters fromraster,terra andstars. Thesetwo changes meant we had to rewrite a large portion of the code base,which implies few backward incompatibilities. The backwardincompatibilities are very small compared to the huge internal changeswe implemented in the foundations of the code and should not even bevisible for most users.

Backward inconpatibilites

  1. lidR no longer loadsraster andsp. To manipulateRaster* andSpatial* objects returned by lidR users need to loadsp andraster with:r library(sp) library(raster) library(lidR)

  2. The formal classLAS no longer inherits the classSpatial fromsp. It means, among other things,that aLAS object no longer has a slot@proj4string with aCRS fromsp,or a slot@bbox. The CRS is now stored in the slot@crs in acrs object fromsf.Former functionscrs() andprojection()inherited fromraster are backward compatible and return aCRS or aproj4string fromsp.However code that accesses these slots manually are no longer valid (butnobody was supposed to do that anyway because it was the purpose of thefunctionprojection()):r las@proj4string # No longer works las@bbox # No longer works inherits(las, "Spatial") # Now returns FALSE

  3. The formal classLAScatalog no longer inherits theclassSpatialPolygonDataFrame fromsp. Itmeans, among other things, that aLAScatalog object nolonger has a slot@proj4string, or@bbox, or@polygons. The slot@data is preserved andcontains ansf,data.frame instead of adata.frame allowing backward compatibility of data accessto be maintained. The syntaxctg$attribute is the way toaccess data, but statement likectg@data$attribute arebackward compatible. However, code that accesses other slots manually isno longer valid, like for theLAS class:r ctg@proj4string # No longer works ctg@bbox # No longer works ctg@polygons # No longer works inherits(ctg, "Spatial") # Now returns FALSE

  4. sp::spplot() no longer works on aLAScatalog because aLAScatalog is no longer aSpatialPolygonDataFramer spplot(ctg, "Max.Z") # becomes plot(ctg["Max.Z"])

  5. raster::projection() no longer works onLAS* objects because they no longer inheritSpatial. Moreover,lidR no longerDepends onraster which means thatraster::projection() andlidR::projection canmask each other. Users should usest_crs() preferentially.To useprojection users can either loadrasterbeforelidR or calllidR::projection() withthe explicit namespace.

    library(lidR)projection(las)# workslibrary(raster)projection(las)# no longer works
  6. SerializedLAS/LAScatalog objects (i.e. stored in.rds or.Rdata files) saved withlidR v3.x.y are no longer compatible withlidR v4.x.y. Indeed, the structure of aLAS/LAScatalog object is now different mainly because theslot@crs replaces the slot@proj4string.Users may get errors when using e.g. readRDS(las.rds) toload back an R object. However we put safeguards in place so, inpractice, it should be backward compatible transparently, and evenrepaired automatically in some circumstances. Consequently we are notsure it is a backward incompatibility because we handled and fixed allwarnings and errors we found. In the worst case it is possible to repairaLAS object v3 with:r las <- LAS(las)

  7. track_sensor() is not backward compatible because itis a very specific function used by probably just 10 people in theworld. We chose not to rename it. It now returns ansfobject instead of aSpatialPointsDataFrame.

New modern functions

Former functions that returnSpatial* objects frompackagesp should no longer be used. It is time foreverybody to embracesf. However, these functions are stillinlidR for backward compatibility. They won’t be removedexcept if packagesp is removed from CRAN. It might happenon Jan 1st 2024, it might happen later. We do not know. New functionsreturnsf orsfc objects. Old functions arenot documented so new users won’t be able to use them.

Older functions that returnRaster* objects from theraster package should no longer be used. It is time foreverybody to embraceterra/stars. However, these functionsare still inlidR for backward compatibility. They won’t beremoved except if packageraster is removed from CRAN. Newfunctions return either aRaster*, aSpatRaster, or astars object, according touser preference.

New features

New functions are mostly convenient features that simplify someworkflow aspects without introducing a lot of brand new functionalitythat did not already exist inlidR v3.

  1. New geometry functionsst_convex_hull() andst_concave_hull() that returnsfc

  2. New modern functionsst_area(),st_bbox(),st_transform() andst_crs() inherited fromsf forLAS* objects.

  3. New convenient functionsnrow(),ncol(),dim(),names() inheritedfrombase forLAS* objects

  4. New operators$,[[,$<- and[[<- onLASheader.The following are now valid statements:r header[["Version Major"]] header[["Z scale factor"]] <- 0.001

  5. Operators$,[[,$<-and[[<- onLAS can now access theLASheader metadata. The following are now valid statements:r las[["Version Major"]] las[["Z scale factor"]] <- 0.001

  6. RStudio now supports auto completion for operator$inLAS objects. Yay!

  7. New functionstemplate_metrics(),hexagon_metrics(),polygon_metrics() thatextend the concept of metrics further to any kind of template.

  8. Functions that used to accept spatial vector or spatial raster asinput now consistently accept any ofSpatial*,sf,sfc,Raster*,SpatRaster andstars objects. This includemerge_spatial(),normalize_intensity(),normalize_height(),rasterize_*(),segment_trees(),plot_dtm3d() and severalothers. We plan to supportSpatVector in futurereleases.

  9. Every function that supports a raster as input now accept an“on-disk” raster fromraster,terra andstars i.e. a raster not loaded in memory. This includesrasterization functions, individual tree segmentation functions,merge_spatial and others, in particularplot_dtm3d() andadd_dtm3d() that nowdownsample on-disk rasters on-the-fly to display very large DTMs.On-disk rasters were already generally supported in previous versionsbut not every function was properly optimized to handle suchobjects.

  10. All the functions that return a raster(pixel_metrics() andrasterize_*()) are rasteragnostic and can return rasters fromraster,terra orstars. They have an argumentpkg = "raster|terra|stars" to choose. The default isterra but this can be changed globally using:r options(lidR.raster.default = "stars")

  11. New functioncatalog_map() that simplifiescatalog_apply() to a large degree. Yet it is not asversatile ascatalog_apply() but well suits around 80% ofuse cases. Applying a user-defined function to a collection of LAS filesis now as simple as:r my_fun <- function(las, ...) { # do something with the point cloud return(something) } res <- catalog_map(ctg, my_fun, param1 = 2, param2 = 5)

  12. Operator[ onLAS object has beenoverloaded to clip a point-cloud using abbox or asfcr sub <- las[sfc]

  13. rasterize_terrain() accepts ansfc asargument to force interpolation within a defined area.

  14. normalize_height() now always interpolates allpoints. It is no longer possible to get an error that some points cannotbe interpolated. The problem of interpolating the DTM where there is nodata is still present but we opted for a nearest neighbour approach witha warning instead of a failure. This prevents the method from failingafter hours of computation for special cases somewhere in the filecollection. This also means we removed thena.rm optionthat is no longer relevant.

  15. New functionsheader(),payload(),phb(),vlr(),evlr() to get thecorresponding data from aLAS object.

  16. New algorithmshp_hline andshp_vlineforsegment_shapes()#499

  17. New algorithmmcc for groundclassification.

Enhancement

  1. The bounding box of the CHM computed withrastertize_canopy() orgrid_canopy() is nolonger affected by thesubcircle tweak. See#518.

  2. readLAS() can now read two or more files that do nothave the same point format (see#508)

  3. plot() forLAS gains argumentspal,breaks andnbreaks similartosf. Argumentstrim andcolorPalette are deprecated

Fix

  1. The metricitot fromstdmetrics_i whichgenerates troubles (see#463#514) is nowdouble instead ofint

Documentation


[8]ページ先頭

©2009-2025 Movatter.jp