gisma-courses / gi-modules

GI Modules is a blog-based collection of learning content in the broad field of r(-)spatial geoinformatics. The blogs are sorted by categories and tags. Under the categories, related content is grouped together. Within the content pages, you can navigate to related articles via the tags.
https://gisma-courses.github.io/gi-modules/
MIT License
0 stars 0 forks source link

Forest Information from LiDAR data-your title #4

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Forest Information from LiDAR data-your title

https://gisma-courses.github.io/gi-modules/gi-modules/post/2021-11-20-forest-information-from-lidar-data/

Muenchj4 commented 2 years ago

Trying to run "make_CHM_tiles.R" and reading the given las File the warning message came: "Invalid data: ScanAngleRank greater than 90 degrees". Further trying lasnormalize the warning message came: "1: lidR::lasnormalize is deprecated. Use normalize_height instead. 2: There were 14 degenerated ground points. Some X Y Z coordinates were repeated. They were removed. 3: There were 180 degenerated ground points. Some X Y coordinates were repeated but with different Z coordinates. min Z were retained." At the end when trying to visualize using mapview the error came: "Error in if (x == "" | x == ".") { : argument is of length zero". How can I handle this problem?

gisma commented 2 years ago

everythng fine so far just dont use mapview. Try to plot the result

Muenchj4 commented 2 years ago

Thank you. The picture is plotted. But why does mapview not work?

Zitat von Chris Reudenbach @.***>:

everythng fine so far just dont use mapview. Try to plot the result

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/gisma-courses/gi-modules/issues/4#issuecomment-989117780

Muenchj4 commented 2 years ago

Now, I am trying to run the Script using MOF_las file. But it does not know "espg_number". What should I input instead?

gisma commented 2 years ago

@Muenchj4 we discussed during the last course it is: https://epsg.io/25832

Muenchj4 commented 2 years ago

thank you. Zitat von Chris Reudenbach @.***>:

@Muenchj4 we discussed during the last course it is: https://epsg.io/25832

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/gisma-courses/gi-modules/issues/4#issuecomment-989194258

Muenchj4 commented 2 years ago

Ok I have set epsg_number = 25832. p2r and knnidw worked well. But trying to normalize height the error came: Processing [========>-------------------------------------------------------------------------------------------------------] 8% (1/12) eta: 9sError: Dataset copy failed What could be the problem?

Muenchj4 commented 2 years ago

sorry, normalize_height also worked well, but it was not able to grid canopy.

Muenchj4 commented 2 years ago

I have found the problem myself. There was not setted a path normalized. I set it myself and rast was able to write the file "chm_distmin_1m", plotted it, but mapview did not work again, since it could not find the function "pal".

gisma commented 2 years ago

@Muenchj4 yup the col function pal is not defined. Just delete the row

Muenchj4 commented 2 years ago

OK, the chm catalog is shown with mapview. Thank godness. Zitat von Chris Reudenbach @.***>:

@Muenchj4 yup the col function pal is not defined. Just delete the row

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/gisma-courses/gi-modules/issues/4#issuecomment-989265116

GeoKL commented 2 years ago

Hello, the script is running, but whenever I try to knit it (for putting it on the website) I get the error:

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS agis_lidar_13-12.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output agis_lidar_13-12.html --lua-filter "E:\edu\Packages\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "E:\edu\Packages\rmarkdown\rmarkdown\lua\latex-div.lua" --self-contained --variable bs3=TRUE --standalone --section-divs --template "E:\edu\Packages\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable theme=bootstrap --include-in-header "C:\Users\Kathi\AppData\Local\Temp\Rtmp4UVnEJ\rmarkdown-str23f05223275.html" --mathjax --variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" pandoc.exe: Cannot decode byte '\xb2': Data.Text.Internal.Encoding.decodeUtf8: Invalid UTF-8 stream Error: pandoc document conversion failed with error 1 Execution halted

What could this be about? Online I didn't find anything about this..

gisma commented 2 years ago

Please sent or upload the markdown file

GeoKL commented 2 years ago

@gisma took me a while, but now I did and sent you an invite.

Muenchj4 commented 2 years ago

Er findet momentan bei mir die Funktion "get_vrt_img" nicht. Wie kann ich diese Funktion einbauen?

Muenchj4 commented 2 years ago

Ich habe das "mof_chm_one_tile.tif" nochmals zu plotten versucht. Es ist prinzipiell auch immer noch im Ordner. Er gibt aber die Meldung aus: Error in h(simpleError(msg, call)) : Fehler bei der Auswertung des Argumentes 'x' bei der Methodenauswahl für Funktion 'plot': object 'mof_chm_one_tile.tif' not found

Muenchj4 commented 2 years ago

Ich habe den Fehler gefunden und den Katalog jetzt erstellt.

gisma commented 2 years ago

versuchen sie es mal mit raster::plot() zu plotten.

gisma commented 2 years ago

das ist eine Funktion die ich ihnen im Kurskontext zur Verfügung gestellt hatte.


get_vrt_img = function(name,path,tag,rasterStack = TRUE) {
fList = list.files(path, 
pattern = glob2rx(paste0("*",tag,".tif")),
full.names = TRUE)

res = invisible(gdalUtils::mosaic_rasters(gdalfile = fList, output_Raster = TRUE, dst_dataset = paste0(path,name,".tif"),verbose = FALSE))

if (rasterStack) return(raster::stack(paste0(path,name,".tif")))

}