You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for responding to that question on gis.stackexchange. I tried sending you this via email, but your email server keeps on rejecting my email both from Outlook and Gmail. The code that I used is below:
# Bring in the ALS fileTP1= readLAS("~/Sample.las")
# Then, normalize the data so that ground points are centered on 0.TP1_DTM= grid_terrain(TP1.pmf, algorithm= knnidw(k=8, p=2))
TP1.normalized= normalize_height(TP1.pmf, TP1_DTM)
# Create a filter to remove points above 95th percentile of heightfilter_noise=function(las, sensitivity)
{
p99= grid_metrics(las, ~quantile(Z, probs=0.99), 10)
las= merge_spatial(las, p99, "p99")
las= filter_poi(las, Z<p99*sensitivity)
las$p99<-NULLreturn(las)
}
TP1_denoised= filter_noise(TP1.normalized, sensitivity=1.2)
# Generate the Canopy Height Model (CHM)TP1.CHM= grid_canopy(TP1_denoised, 0.5, pitfree(c(0,2,5,10,20), c(3,1.5), subcircle=0.2))
plot_dtm3d(TP1.CHM)
# Here a single 5x5 moving window is used to apply a median filter:win=matrix(1,5,5)
TP1.chm_s= focal(TP1.CHM, w=win, fun=median)
TP1.wtrshd= watershed(TP1.chm_s, th=20)
TP1.ITD.wtrshd= segment_trees(TP1_denoised, TP1.wtrshd)
# Hulls from the Watershed methodTP1_hulls_wtrshd= delineate_crowns(TP1.ITD.wtrshd, func=.stdmetrics)
Errorinsp::SpatialPolygons(hulls[["poly"]]) : is.list(Srl) isnotTRUE
Kind Regards,
The text was updated successfully, but these errors were encountered:
I answered on gis.stackexchange. I keep the issue opened to improve the code and handle this edge case with a more informative error. Btw you should not be that scared of sharing a microscopic 1000 m² of data containing shurbs lost in the desert. Anyway I deleted the link after I downloaded the file in your message. because github is also a public place. You can remove the file from were it is strored. Thank you for reporting the issue.
Good day Jean,
Thank you for responding to that question on gis.stackexchange. I tried sending you this via email, but your email server keeps on rejecting my email both from Outlook and Gmail. The code that I used is below:
Kind Regards,
The text was updated successfully, but these errors were encountered: