Closed QuirinH closed 6 years ago
Hi Quirin,
The function uses the resolution of the raster to figure out how many cells the window needs to cover. Since it can't know what unit the raster values are in, it assumes that they are the same as the map unit. The problem here is that your raster values are presumably in meters while your resolution is in degrees decimal.
Andrew
Hi Andrew,
Thank you so much for the quick reply! Stupid mistake on my side… It is running now.
Cheers, Quirin
—
Quirin Hohendorf
MSc student School of Environmental Studies, University of Victoria Faculty of Graduate Studies Council Representative
On Feb 4, 2018, at 9:32 PM, Andrew Plowright notifications@github.com wrote:
Hi Quirin,
The function uses the resolution of the raster to figure out how many cells the window needs to cover. Since it can't know what unit the raster values are in, it assumes that they are the same as the map unit. The problem here is that your raster values are presumably in meters while your resolution is in degrees decimal.
Andrew
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AndyPL22/ForestTools/issues/4#issuecomment-362985969, or mute the thread https://github.com/notifications/unsubscribe-auth/AieMaGHXE4IncBQ7X1grWfJoUzNemZD3ks5tRpJ3gaJpZM4R46vw.
No problem Quirin, Good luck with your analysis
Hi Andrew and Quiring
I am Having this error;Error in vwf(CHM = fri_chm, winFun = lin, minHeight = 2) : Input function for 'winFun' yields a window diameter of 119 cells, which is wider than the maximum allowable value in 'maxWinDiameter'. Change the 'winFun' function or set 'maxWinDiameter' to a higher value (or to NULL)
I think it is the same issue raised, but I am still a beginner and I am not sure how to rectify this.
This is the code; library(ForestTools) library(raster) library(rgdal) fri_chm <- raster("G:/MSc Thesis/UAV DATA/Resampling/chm/fri_chm.tif") plot(fri_chm, xlab = "", ylab = "", xaxt='n', yaxt = 'n') lin <- function(x){x * 0.05 + 0.6} ttops <- vwf(CHM = fri_chm, winFun = lin, minHeight = 2)
Please help!
Hi Tehn01,
I am citing Andrew from above: "The problem here is that your raster values are presumably in meters while your resolution is in degrees decimal." IT was a simple mistake on my end.
For my data it helped to change the dimension to degrees decimal if I remember correctly. I can did up my analysis if that doesn't help.
Good Luck!
Hi @Tehn01,
What @QuirinH said is indeed a common issue. Let's confirm: can you tell us what projection system your CHM is in?
Andrew
Hi @QuirinH @andrew-plowright
Thank you for the feedback, and yes you were right. it was a projection issue. I however have a new inquiry today.
I managed to run the treetop detection and crowns segmentation, however the results are not convincing since most treetops and crowns are not tagged. Is there a way I can improve on the linear function of play around window size for better results?
Cheers!
@Tehn01 yes, the window size is dynamically set by the winFun
argument, which takes a function that relates the CHM pixel value to the search window's radius.
The inventors of the algorithm discuss ways to calibrate the window function to specific forest structures: https://www.ingentaconnect.com/contentone/asprs/pers/2004/00000070/00000005/art00003?crawler=true
Hi,
I am having trouble with the TreeTopFinder in ForestTools. The winFun function seems to result in oversized window sizes that give me back an error.
My code:
library(ForestTools)
library(raster)
raster <- raster("~/Desktop/FileName.tif")
lin <- function(x){x * 0.05 + 0.6}
The data has the following specs:
ttops <- TreeTopFinder(CHM = raster, winFun = lin, minHeight = 5, verbose = TRUE)
I am not sure why the calculated values for window size a re so big. My max value in the data is 33.2. Thank you for your support!
Cheers, Quirin