Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot_metrics fails with empty point cloud #551

Closed
Jean-Romain opened this issue Mar 21, 2022 · 1 comment
Closed

plot_metrics fails with empty point cloud #551

Jean-Romain opened this issue Mar 21, 2022 · 1 comment
Assignees
Labels
Bug A bug in the package

Comments

@Jean-Romain
Copy link
Collaborator

library(lidR)

shpfile <- system.file("extdata", "efi_plot.shp", package="lidR")
inventory <- sf::st_read(shpfile, quiet = TRUE)
inventory # contains an ID and a Value Of Interest (VOI) per plot

LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile, filter = "-keep_random_fraction 0.5 -keep_z_above 25")

m <- plot_metrics(las, .stdmetrics_rn, inventory, radius = 11.28)
#> Erreur dans `[[<-.data.frame`(`*tmp*`, "echo", value = 0L) : 
#>   le tableau de remplacement a 1 lignes, le tableau remplacé en a 0
#> De plus : Messages d'avis :
#> 1: Dans clip_circle.LAS(las, xcenter, ycenter, radius, data = geometry) :
#>   No point found for within disc (684855.025226659, 5017891.2092272, 11.28).
#> 2: Dans clip_circle.LAS(las, xcenter, ycenter, radius, data = geometry) :
#>   No point found for within disc (684943.973480844, 5017795.88158072, 11.28).
#> 3: Dans min(x) : aucun argument trouvé pour min ; Inf est renvoyé
#> 4: Dans max(x) : aucun argument pour max ; -Inf est renvoyé
#> 5: Dans min(x) : aucun argument trouvé pour min ; Inf est renvoyé
#> 6: Dans max(x) :
#>  Erreur dans `[[<-.data.frame`(`*tmp*`, "echo", value = 0L) : 
#> le tableau de remplacement a 1 lignes, le tableau remplacé en a 0
@Jean-Romain
Copy link
Collaborator Author

Jean-Romain commented Mar 21, 2022

library(lidR)

shpfile <- system.file("extdata", "efi_plot.shp", package="lidR")
inventory <- sf::st_read(shpfile, quiet = TRUE)
inventory 

LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile, filter = "-keep_random_fraction 0.5 -keep_z_above 25")

m <- plot_metrics(las, .stdmetrics_rn, inventory, radius = 11.28)
#> Warning: No point found for within disc (684943.973480844, 5017795.88158072,
#> 11.28).
#> Warning: Plots [5] are empty. The entries have been removed.
m
#> Simple feature collection with 5 features and 8 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 684838.9 ymin: 5017796 xmax: 684976.6 ymax: 5017958
#> Projected CRS: NAD83 / UTM zone 17N
#>   IDPEP       VOI p1th p2th p3th p4th p5th pground                 geometry
#> 1 PEPQ1 14.157140  100    0    0    0    0       0 POINT (684976.6 5017821)
#> 2 PEPQ2 12.720584  100    0    0    0    0       0 POINT (684923.9 5017958)
#> 3 PEPQ3 11.396656  100    0    0    0    0       0 POINT (684838.9 5017942)
#> 4 PEPQ4 11.597471  100    0    0    0    0       0   POINT (684855 5017891)
#> 5 PEPQ5  8.263425   NA   NA   NA   NA   NA      NA   POINT (684944 5017796)

Created on 2022-03-21 by the reprex package (v2.0.1)

@Jean-Romain Jean-Romain self-assigned this Apr 11, 2022
@Jean-Romain Jean-Romain added the Bug A bug in the package label Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in the package
Projects
None yet
Development

No branches or pull requests

1 participant