I am running a clean version of Spades and all biomass module (development branch) using default values and I am running into an error when the kNN-species.tar file is being built. The invalid octal digit error usually mean that the .tar is empty or corrupted so the module doesn't seem to be downloading the proper NFI modis files from the ftp repository (49kb is very small for modis raster layers) Does anybody have the same problem or know what could be the problem?
I have tried investigating the problem and I think it might reside in the sppEquivalencies_CA table where there is mismatch between file names for species modis file and table content (see code below). I do not know how the loadkNNSpeciesLayers function handle missing file from its sppEquiv argument upon connection to the ftp site, but an error there could explain why the results is an empty .tar.
Entries from the Boreal column of sppEquivalencies_CA table that are not present on the ftp site.
Frax_spp
Pice_Eng_Gla
+ other, I stopped trying at this point
I am open to suggestions....
Cheers
Louis
######### Error log
Spade core v2.0.7
Biomass_borealDataPrep v1.4.0.9000 (development, Downloaded Jan 6 2020)
To reproduce download and execute the .rmd file of the biomass_borealDataPrep module (development branch)
Terminal Log:
There is no 'sppEquiv' table supplied; will attempt to use species listed under 'Boreal' in the 'LandR::sppEquivalencies_CA' table
Preparing: kNN-Species.tar
Checking local files...
Finished checking local files.
Downloading: 49 kB Checking local files...
Finished checking local files.
Downloaded file has no extension: both targetFile and archive are provided.
Downloaded file will be considered as the archive.
Error in getOctD(x, offset, len) : invalid octal digit
In addition: Warning messages:
1: In .inputObjects(sim) : studyArea and rasterToMatch projections differ.
studyArea will be projected to match rasterToMatch
2: In .inputObjects(sim) :
Error in getOctD(x, offset, len) : invalid octal digit
#Problem line
Cache(loadkNNSpeciesLayers, dPath = dPath, rasterToMatch = sim$rasterToMatchLarge,
studyArea = sim$studyAreaLarge, sppEquiv = sim$sppEquiv,
knnNamesCol = "KNN", sppEquivCol = P(sim)$sppEquivCol, thresh = 10,
url = extractURL("speciesLayers"), userTags = c(cacheTags, ... at Biomass_borealDataPrep.R#895
##### Spp equiv table dowloand code
#Using same code logic as the module
"canada-forests-attributes_attributs-forests-canada/2001-attributes_attributs-2001/")
fileNames <- getHTMLLinks(dataurl)
#filter table
b<-LandR::sppEquivalencies_CA
b<-b[!"", on = "Boreal"]
#download data and save
for (i in 1:nrow(b)){
spname<-b[i,11]
spfilename <- grep(paste0(spname,".*.tif$"), fileNames, value = TRUE)
sppURL<-paste0(dataurl,spfilename)
download.file(sppURL,paste0("YOURDIRECTORY", spfilename))
}