gisma / uavRst

UAV related Remote Sensing Toolbox
https://gisma.github.io/uavRst
41 stars 17 forks source link

Installation from github #12

Closed PaulScholefield closed 4 years ago

PaulScholefield commented 6 years ago

githubinstall("uavRst") Suggestion:

  • gisma/uavRst Unmanned Aerial Vehicle Remote Sensing Tools Do you want to install the package (Y/n)? y Downloading GitHub repo gisma/uavRst@master from URL https://api.github.com/repos/gisma/uavRst/zipball/master Installing uavRst "C:/PROGRA~1/R/R-35~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \ "C:/Users/paul1/AppData/Local/Temp/Rtmp029tId/devtools50e42d90366f/gisma-uavRst-eaee888" \ --library="C:/Users/paul1/Documents/R/win-library/3.5" --install-tests

*** arch - i386 c:/Rtools/mingw_32/bin/g++ -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -I"C:/Users/paul1/Documents/R/win-library/3.5/Rcpp/include" -O2 -Wall -mtune=generic -c RcppExports.cpp -o RcppExports.o c:/Rtools/mingw_32/bin/g++ -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -I"C:/Users/paul1/Documents/R/win-library/3.5/Rcpp/include" -O2 -Wall -mtune=generic -c brewCppFun.cpp -o brewCppFun.o brewCppFun.cpp: In function 'std::string mergePopupRows(Rcpp::CharacterVector, Rcpp::CharacterVector)': brewCppFun.cpp:110:18: warning: suggest parentheses around comparison in operand of '|' [-Wparentheses] if (names[i] == "Feature ID" | ^ brewCppFun.cpp:111:46: warning: suggest parentheses around comparison in operand of '|' [-Wparentheses] names[i] == "Longitude" | names[i] == "Latitude") { ^ c:/Rtools/mingw_32/bin/g++ -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -I"C:/Users/paul1/Documents/R/win-library/3.5/Rcpp/include" -O2 -Wall -mtune=generic -c mapviewCppFun.cpp -o mapviewCppFun.o c:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o uavRst.dll tmp.def RcppExports.o brewCppFun.o mapviewCppFun.o -LC:/PROGRA~1/R/R-35~1.0/bin/i386 -lR installing to C:/Users/paul1/Documents/R/win-library/3.5/uavRst/libs/i386

* arch - x64 c:/Rtools/mingw_64/bin/g++ -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -I"C:/Users/paul1/Documents/R/win-library/3.5/Rcpp/include" -O2 -Wall -mtune=generic -c RcppExports.cpp -o RcppExports.o c:/Rtools/mingw_64/bin/g++ -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -I"C:/Users/paul1/Documents/R/win-library/3.5/Rcpp/include" -O2 -Wall -mtune=generic -c brewCppFun.cpp -o brewCppFun.o brewCppFun.cpp: In function 'std::string mergePopupRows(Rcpp::CharacterVector, Rcpp::CharacterVector)': brewCppFun.cpp:110:18: warning: suggest parentheses around comparison in operand of '|' [-Wparentheses] if (names[i] == "Feature ID" | ^ brewCppFun.cpp:111:46: warning: suggest parentheses around comparison in operand of '|' [-Wparentheses] names[i] == "Longitude" | names[i] == "Latitude") { ^ c:/Rtools/mingw_64/bin/g++ -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -I"C:/Users/paul1/Documents/R/win-library/3.5/Rcpp/include" -O2 -Wall -mtune=generic -c mapviewCppFun.cpp -o mapviewCppFun.o c:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o uavRst.dll tmp.def RcppExports.o brewCppFun.o mapviewCppFun.o -LC:/PROGRA~1/R/R-35~1.0/bin/x64 -lR installing to C:/Users/paul1/Documents/R/win-library/3.5/uavRst/libs/x64 R data inst ** byte-compile and prepare package for lazy loading Error : object 'readlasheader' is not exported by 'namespace:rlas' ERROR: lazy loading failed for package 'uavRst'

PaulScholefield commented 6 years ago

readlasdataand readlasheader were definitively removed. with ### rlas v1.2.4 (Release date: 2018-06-10) and replaced with read.lasheader

In uavRst: R/rs_pc2D_dsm.R +2 −2 R/rs_pc2D_dtm.R +2 −2 R/rs_pc2D_dtmmw.R +1 −1 R/uavRst-package.R

were all updated with read.lasheader

So why is the installation warning trying to use readlasheader?? I'm confused. This is also an issue on my Mac OSX installation. I tried changing read.lasheader back to readlasheader, and still receiev the same message.

Many thanks!

gisma commented 6 years ago

I'am quite remote. Partly it is fixed. I will fix Thema temaining Dependencies as soon as possible.

ahmedshovon commented 6 years ago

The downloaded binary packages are in C:\Users\ahmed\AppData\Local\Temp\Rtmp0EPvKH\downloaded_packages Installing 1 package: zoo Installing package into 'C:/Users/ahmed/Documents/R/win-library/3.5' (as 'lib' is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/zoo_1.8-4.zip' Content type 'application/zip' length 1099080 bytes (1.0 MB) downloaded 1.0 MB

package 'zoo' successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package 'zoo'

The downloaded binary packages are in C:\Users\ahmed\AppData\Local\Temp\Rtmp0EPvKH\downloaded_packages "C:/PROGRA~1/R/R-35~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD \ INSTALL "C:/Users/ahmed/AppData/Local/Temp/Rtmp0EPvKH/devtools4b94575a6a52/gisma-uavRst-8ed33fd" \ --library="C:/Users/ahmed/Documents/R/win-library/3.5" --install-tests

ERROR: dependencies 'Rcpp', 'zoo', 'data.table' are not available for package 'uavRst'

gisma commented 6 years ago

@ahmedshovon pls try to install the dependencies 'Rcpp', 'zoo', 'data.table' manually before you use the githubinstall package. alternatively you can use: devtools::install_github("gisma/uavRst", ref = "master",dependencies =TRUE, force=TRUE)

gisma commented 6 years ago

@PaulScholefield I have fixed the broken rlas and lidR function calls. Same with the rcpp warnings and quatation issues. Pls check if the installation via githubinstall is running now.

PaulScholefield commented 6 years ago

Now installs successfully ! many thanks.

However, looks like OTB needs sorting out now, since:

dsm1 <- uavRst::pc2dsm(lasDir = "lasdata.las",

  • gisdbase_path = projRootDir,
  • type_smooth = "gauss",
  • otb_gauss_radius = gauss,
  • grid_size = actual_grid_size,
  • GRASSlocation = "dsm",
  • grass_lidar_method = "mean",
  • giLinks = giLinks)[[1]]

Error: 'pc2dsm' is not an exported object from 'namespace:uavRst'

Checked OTB:

linkOTB() $pathOTB [1] "C:\OSGeo4W64\bin\"

$version binDir baseDir installation_type 1 C:\OSGeo4W64\bin\ C:\OSGeo4W64 osgeo4w64OTB

OTB not present in session_info(): So the next hurdle seems to be to get OTB working with link2GI

But I found a function pc2D_dsm {uavRst}

so tried to create 2D pointcloud DSM using the function example, which works to a point....

dsm1 <- pc2D_dsm(laspcFile = paste0(path_las,"lasdata.las"), gisdbasePath = projRootDir, sampleMethod = "max", targetGridSize = 0.5, giLinks = giLinks)

dsm1 <- uavRst::pc2D_dsm(laspcFile = paste0(path_las,"lasdata.las"),

  • gisdbasePath = projRootDir,
  • sampleMethod = "max",
  • targetGridSize = 0.5,
  • giLinks = giLinks)

:: get extent of the point cloud :: link to GRASS :: sampling max altitudes using : 0.5 meter grid size :: filling no data values if so Error in bin_gdal_info(rtmpfl11, to_int) : no such file: E:/Projects/Canopy_height/pc2D_dsm/PERMANENT/.tmp/unknown/dsm0.5 In addition: Warning messages: 1: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.in.lidar.exe --overwrite --quiet -o -e -n input=E:/Projects/Canopy_height/run/448000_318000_449999_99_319999_99.las output=dsm0.5 method=max pth=20 resolution=0.5' had status 255 2: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.info.exe -g map=dsm0.5' had status 1 3: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.info.exe -r map=dsm0.5' had status 1

Not sure if this was the way to go, but I think I'm stuck now with the pc2D_dsm function.

Also:

myenv <- rsaga.env(workspace="C:/sagadata", path="C:/OSGeo4W64/apps/saga") Verify specified path to SAGA command line program... Found SAGA command line program. Search for not specified SAGA modules path... Done tPos <- uavRst::treepos(chmR,

  • minTreeAlt = minTreeAlt,
  • minCrownArea = 1,
  • maxCrownArea = maxCrownArea,
  • join = 1,
  • thresh = 0.35,
  • giLinks = giLinks )

:: start crown identification... :: run pre-segmentation... Error in system(paste0(sagaCmd, " imagery_segmentation 0 ", " -GRID ", : 'C:\Program' not found

Any ideas? Here is the session info:

session_info() Session info --------------------------------------------------------------------------------------------- setting value
version R version 3.5.0 (2018-04-23) system x86_64, mingw32
ui RStudio (1.1.453)
language (EN)
collate English_United Kingdom.1252 tz Europe/London
date 2018-09-24

Packages ------------------------------------------------------------------------------------------------- package version date source
abind 1.4-5 2016-07-21 CRAN (R 3.5.0)
assertthat 0.2.0 2017-04-11 CRAN (R 3.5.1)
backports 1.1.2 2017-12-13 CRAN (R 3.5.0)
base
3.5.0 2018-04-23 local
base64enc 0.1-3 2015-07-28 CRAN (R 3.5.0)
bindr 0.1.1 2018-03-13 CRAN (R 3.5.1)
bindrcpp 0.2.2 2018-03-29 CRAN (R 3.5.1)
bitops 1.0-6 2013-08-17 CRAN (R 3.5.0)
broom 0.5.0 2018-07-17 CRAN (R 3.5.1)
caret 6.0-80 2018-05-26 CRAN (R 3.5.1)
CAST 0.2.1 2018-07-12 CRAN (R 3.5.1)
class 7.3-14 2015-08-30 CRAN (R 3.5.0)
classInt 0.2-3 2018-04-16 CRAN (R 3.5.1)
codetools 0.2-15 2016-10-05 CRAN (R 3.5.0)
colorspace 1.3-2 2016-12-14 CRAN (R 3.5.1)
compiler 3.5.0 2018-04-23 local
crayon 1.3.4 2017-09-16 CRAN (R 3.5.1)
crosstalk 1.0.0 2016-12-21 CRAN (R 3.5.1)
curl 3.2 2018-03-28 CRAN (R 3.5.1)
CVST 0.2-2 2018-05-26 CRAN (R 3.5.1)
data.table 1.11.6 2018-09-19 CRAN (R 3.5.1)
datasets
3.5.0 2018-04-23 local
DBI 1.0.0 2018-05-02 CRAN (R 3.5.1)
ddalpha 1.3.4 2018-06-23 CRAN (R 3.5.1)
deldir 0.1-15 2018-04-01 CRAN (R 3.5.1)
DEoptimR 1.0-8 2016-11-19 CRAN (R 3.5.0)
devtools 1.13.6 2018-06-27 CRAN (R 3.5.1)
digest 0.6.17 2018-09-12 CRAN (R 3.5.0)
dimRed 0.1.0 2017-05-04 CRAN (R 3.5.1)
doParallel 1.0.11 2017-09-28 CRAN (R 3.5.1)
dplyr 0.7.6 2018-06-29 CRAN (R 3.5.1)
DRR 0.0.3 2018-01-06 CRAN (R 3.5.1)
e1071 1.7-0 2018-07-28 CRAN (R 3.5.1)
FNN 1.1.2.1 2018-08-10 CRAN (R 3.5.1)
foreach 1.4.4 2017-12-12 CRAN (R 3.5.1)
foreign
0.8-71 2018-07-20 CRAN (R 3.5.1)
ForestTools 0.2.0 2018-04-04 CRAN (R 3.5.1)
gdalUtils
2.0.1.14 2018-04-23 CRAN (R 3.5.1)
geometry 0.3-6 2015-09-09 CRAN (R 3.5.1)
geosphere 1.5-7 2017-11-05 CRAN (R 3.5.1)
ggplot2 3.0.0 2018-07-03 CRAN (R 3.5.1)
glue 1.3.0 2018-07-17 CRAN (R 3.5.1)
goftest 1.1-1 2017-04-03 CRAN (R 3.5.0)
gower 0.1.2 2017-02-23 CRAN (R 3.5.1)
graphics 3.5.0 2018-04-23 local
grDevices
3.5.0 2018-04-23 local
grid 3.5.0 2018-04-23 local
gstat 1.1-6 2018-04-02 CRAN (R 3.5.1)
gtable 0.2.0 2016-02-26 CRAN (R 3.5.1)
hms 0.4.2 2018-03-10 CRAN (R 3.5.1)
htmltools 0.3.6 2017-04-28 CRAN (R 3.5.1)
htmlwidgets 1.2 2018-04-19 CRAN (R 3.5.1)
httpuv 1.4.5 2018-07-19 CRAN (R 3.5.1)
igraph 1.2.2 2018-07-27 CRAN (R 3.5.1)
intervals 0.15.1 2015-08-27 CRAN (R 3.5.0)
ipred 0.9-7 2018-08-14 CRAN (R 3.5.1)
itcSegment
0.8 2018-03-23 CRAN (R 3.5.1)
iterators 1.0.10 2018-07-13 CRAN (R 3.5.1)
jsonlite 1.5 2017-06-01 CRAN (R 3.5.1)
kernlab 0.9-27 2018-08-10 CRAN (R 3.5.1)
knitr 1.20 2018-02-20 CRAN (R 3.5.1)
later 0.7.4 2018-08-31 CRAN (R 3.5.1)
lattice 0.20-35 2017-03-25 CRAN (R 3.5.0)
lava 1.6.3 2018-08-10 CRAN (R 3.5.1)
lazyeval 0.2.1 2017-10-29 CRAN (R 3.5.1)
leaflet 2.0.2 2018-08-27 CRAN (R 3.5.1)
lidR 1.6.1 2018-09-05 Github (Jean-Romain/lidR@a29b930)
link2GI 0.3-3 2018-09-24 Github (gisma/link2GI@0a66f0b)
log4r 0.2 2014-09-29 CRAN (R 3.5.1)
lubridate 1.7.4 2018-04-11 CRAN (R 3.5.1)
magic 1.5-8 2018-01-26 CRAN (R 3.5.0)
magrittr 1.5 2014-11-22 CRAN (R 3.5.1)
manipulateWidget 0.10.0 2018-06-11 CRAN (R 3.5.1)
maptools
0.9-4 2018-09-19 CRAN (R 3.5.1)
mapview 2.6.0 2018-09-16 CRAN (R 3.5.1)
MASS 7.3-50 2018-04-30 CRAN (R 3.5.1)
Matrix 1.2-14 2018-04-13 CRAN (R 3.5.0)
memoise 1.1.0 2017-04-21 CRAN (R 3.5.1)
methods
3.5.0 2018-04-23 local
mgcv 1.8-24 2018-06-23 CRAN (R 3.5.1)
mime 0.5 2016-07-07 CRAN (R 3.5.0)
miniUI 0.1.1.1 2018-05-18 CRAN (R 3.5.1)
mmap 0.6-17 2018-06-27 CRAN (R 3.5.0)
ModelMetrics 1.2.0 2018-08-10 CRAN (R 3.5.1)
munsell 0.5.0 2018-06-12 CRAN (R 3.5.1)
nlme 3.1-137 2018-04-07 CRAN (R 3.5.0)
nnet 7.3-12 2016-02-02 CRAN (R 3.5.0)
parallel 3.5.0 2018-04-23 local
pillar 1.3.0 2018-07-14 CRAN (R 3.5.1)
pkgconfig 2.0.2 2018-08-16 CRAN (R 3.5.1)
pls 2.7-0 2018-08-21 CRAN (R 3.5.1)
plyr 1.8.4 2016-06-08 CRAN (R 3.5.1)
png 0.1-7 2013-12-03 CRAN (R 3.5.0)
polyclip 1.9-1 2018-07-27 CRAN (R 3.5.1)
pROC 1.12.1 2018-05-06 CRAN (R 3.5.1)
prodlim 2018.04.18 2018-04-18 CRAN (R 3.5.1)
promises 1.0.1 2018-04-13 CRAN (R 3.5.1)
purrr 0.2.5 2018-05-29 CRAN (R 3.5.1)
R.methodsS3 1.7.1 2016-02-16 CRAN (R 3.5.0)
R.oo 1.22.0 2018-04-22 CRAN (R 3.5.0)
R.utils 2.7.0 2018-08-27 CRAN (R 3.5.1)
R6 2.2.2 2017-06-17 CRAN (R 3.5.1)
raster
2.6-7 2017-11-13 CRAN (R 3.5.1)
Rcpp 0.12.18 2018-07-23 CRAN (R 3.5.1)
RcppRoll 0.3.0 2018-06-05 CRAN (R 3.5.1)
readr 1.1.1 2017-05-16 CRAN (R 3.5.1)
recipes 0.1.3 2018-06-16 CRAN (R 3.5.1)
reshape2 1.4.3 2017-12-11 CRAN (R 3.5.1)
reticulate 1.10 2018-08-05 CRAN (R 3.5.1)
rgdal
1.3-4 2018-08-03 CRAN (R 3.5.1)
rgeos 0.3-28 2018-06-08 CRAN (R 3.5.1)
rgl 0.99.16 2018-03-28 CRAN (R 3.5.1)
rgrass7 0.1-10 2017-10-11 CRAN (R 3.5.1)
rlang 0.2.2 2018-08-16 CRAN (R 3.5.1)
rlas
1.2.7 2018-08-21 CRAN (R 3.5.1)
rLiDAR 0.1.1 2017-07-12 CRAN (R 3.5.1)
robustbase 0.93-2 2018-07-27 CRAN (R 3.5.1)
rpart 4.1-13 2018-02-23 CRAN (R 3.5.0)
RQGIS 1.0.4.9000 2018-09-24 Github (jannes-m/RQGIS@435b6c8)
RSAGA
1.2.0 2018-09-24 Github (be-marc/RSAGA@ae6b443)
Rsagacmd 0.1.0 2018-09-24 Github (stevenpawley/sagacmd@3e77504) rstudioapi 0.7 2017-09-07 CRAN (R 3.5.1)
satellite 1.0.1 2017-10-18 CRAN (R 3.5.1)
scales 1.0.0 2018-08-09 CRAN (R 3.5.1)
sf 0.6-3 2018-05-17 CRAN (R 3.5.1)
sfsmisc 1.1-2 2018-03-05 CRAN (R 3.5.1)
shapefiles
0.7 2013-01-26 CRAN (R 3.5.1)
shiny 1.1.0 2018-05-17 CRAN (R 3.5.1)
sp 1.3-1 2018-06-05 CRAN (R 3.5.1)
spacetime 1.2-2 2018-07-17 CRAN (R 3.5.1)
spatial.tools 1.6.0 2018-04-23 CRAN (R 3.5.1)
spatstat 1.56-1 2018-08-01 CRAN (R 3.5.1)
spatstat.data 1.3-1 2018-06-11 CRAN (R 3.5.1)
spatstat.utils 1.9-0 2018-07-28 CRAN (R 3.5.1)
spData 0.2.9.3 2018-08-01 CRAN (R 3.5.1)
splines 3.5.0 2018-04-23 local
stats
3.5.0 2018-04-23 local
stats4 3.5.0 2018-04-23 local
stringi 1.2.4 2018-07-20 CRAN (R 3.5.0)
stringr 1.3.1 2018-05-10 CRAN (R 3.5.1)
survival 2.42-6 2018-07-13 CRAN (R 3.5.1)
tensor 1.5 2012-05-05 CRAN (R 3.5.0)
tibble 1.4.2 2018-01-22 CRAN (R 3.5.1)
tidyr 0.8.1 2018-05-18 CRAN (R 3.5.1)
tidyselect 0.2.4 2018-02-26 CRAN (R 3.5.1)
timeDate 3043.102 2018-02-21 CRAN (R 3.5.1)
tools 3.5.0 2018-04-23 local
uavRst 0.4-3 2018-09-24 Github (gisma/uavRst@e104ee3)
units 0.6-0 2018-06-09 CRAN (R 3.5.1)
utils
3.5.0 2018-04-23 local
velox 0.2.0 2017-12-01 CRAN (R 3.5.1)
viridisLite 0.3.0 2018-02-01 CRAN (R 3.5.1)
webshot 0.5.0 2017-11-29 CRAN (R 3.5.1)
withr 2.1.2 2018-03-15 CRAN (R 3.5.1)
XML 3.98-1.16 2018-08-19 CRAN (R 3.5.1)
xtable 1.8-3 2018-08-29 CRAN (R 3.5.1)
xts 0.11-1 2018-09-12 CRAN (R 3.5.0)
yaml 2.2.0 2018-07-25 CRAN (R 3.5.1)
zoo 1.8-4 2018-09-19 CRAN (R 3.5.1)

gisma commented 6 years ago

@PaulScholefield I have updated the package. Please check again. Please use also the latest version of link2GI. In addition it would be helpful if you provide me your full calling script. As far as I see you are running a GRASS version without the function r.in.lidar. You may install it from R after calling thelinkGRASS7() funktion with system("g.extension extension=r.in.lidar") Furthermore there are obviously some probs with SAGA GIS. OTB seems to be fine however did you link SAGA? You should provide the function call the whole giLinks list. You may use the uavRst::get_gi() function to generate the list and to set up all environment variables.

PaulScholefield commented 6 years ago

has r.in.lidar been replaced by r.in.pdal in liblas? Looks like more recent version of Grass no longer have r.in.lidar which might be the cause of some of the problems. see: https://liblas.org/ as of 2018....

gisma commented 6 years ago

At least it was planned. Unfortunately I have to fix this in quite a number functions. However for the current stable versions I was able to install r.in.lidar. Sio it should work. future plans are to check if both extensions are installed and if not give the user an advice to do so. In addition I will clean up the functions so that both function can be used. Probably this will be done with the first CRAN release planned at the end of October.

PaulScholefield commented 6 years ago

I have 4 installations of Grass , none of which had r.in.lidar, so will try to find a version. And thankyou for your help :-)

gisma commented 6 years ago

you have to install it manually within the GRASS GUI/CLI or from R after calling thelinkGRASS7() funktion with system("g.extension extension=r.in.lidar") As I wrote it should work for mos of the versions I am running it from 7.05 to 7.41

PaulScholefield commented 6 years ago

I tried using the GRASS CLI (7.4.1) and it couldn't find the extension in the repository, so I need to find an older version of GRASS perhaps.

C:>g.extension extension=r.in.lidar Downloading precompiled GRASS Addons <r.in.lidar>... ERROR: Extension <r.in.lidar> not found

gisma commented 6 years ago

@PaulScholefield I have added the r.in.pdal switch. Actually it checks before calling r.in.lidar/r.in.pdal if r.in.lidar exists. if so it takes the r.in.lidar module if not the new r.in.pdal. I am not able to test it completely right now (especially not under windows). For the moment it seems to run with GRASS 7.4.1. I had to install manually the PDAL binaries and libs. So please check. Any feedback is welcome. Please note also that I have changed the function name of the before mentioned uavRst::get_gi() to uavRst::linkAll()

PaulScholefield commented 6 years ago

dsm <- uavRst::pc2D_dsm(laspcFile = paste0(path_las,"lasdata.las"),

  • gisdbasePath = projRootDir,
  • sampleMethod = "max",
  • targetGridSize = 0.5,
  • giLinks = giLinks) :: create copy of the las file at the working directory... :: get extent of the point cloud :: link to GRASS You have more than one valid GRASS GIS version instDir version installation_type 1 C:\OSGeo4W64 grass-6.4.3 osgeo4W 2 C:\OSGeo4W64 grass-7.4.1 osgeo4W 3 C:\OSGeo4W64 grass-7.7.svn osgeo4W 4 C:\PROGRA~1\QGIS2~1.18 grass-7.0.5 osgeo4W

Please select one: 2 :: sampling max altitudes using : 0.5 meter grid size Command: r.in.lidar Extension: .exe Description: Creates a raster map from LAS LiDAR points using univariate statistics. Keywords: raster, import, LIDAR Parameters: name: input, type: string, required: yes, multiple: no keydesc: name, keydesc_count: 1 [LiDAR input files in LAS format (.las or .laz)] name: output, type: string, required: yes, multiple: no keydesc: name, keydesc_count: 1 [Name for output raster map] name: method, type: string, required: no, multiple: no default: mean [Statistic to use for raster values] name: type, type: string, required: no, multiple: no default: FCELL [Storage type for resultant raster map] name: zrange, type: float, required: no, multiple: no keydesc: min,max, keydesc_count: 2 [Filter range for z data (min,max)] name: zscale, type: float, required: no, multiple: no default: 1.0 [Scale to apply to z data] name: percent, type: integer, required: no, multiple: no default: 100 [Percent of map to keep in memory] name: pth, type: integer, required: no, multiple: no [pth percentile of the values] name: trim, type: float, required: no, multiple: no [Discard percent of the smallest and percent of the largest observations] name: resolution, type: float, required: no, multiple: no [Output raster resolution] name: return_filter, type: string, required: no, multiple: no [If not specified, all points are imported] name: class_filter, type: integer, required: no, multiple: yes [Input is comma separated integers. If not specified, all points are imported.] Flags: name: p [Print LAS file info and exit] {TRUE} name: e [Extend region extents based on new dataset] {FALSE} name: o [Override dataset projection (use location's projection)] {FALSE} name: s [Scan data file for extent then exit] {TRUE} name: g [In scan mode, print using shell script style] {FALSE} name: i [Import intensity values rather than z values] {FALSE} name: overwrite [Allow output files to overwrite existing files] {FALSE} name: help [Print usage summary] {FALSE} name: verbose [Verbose module output] {FALSE} name: quiet [Quiet module output] {FALSE} Error in doGRASS(cmd, flags = flags, ..., parameters = parameters, echoCmd = echoCmd, : Invalid flag value: n

We're getting further.... Looks as if it is still looking for r.in.lidar though.

I used: giLinks<-uavRst::linkAll()

Many thanks....!

gisma commented 6 years ago

Fine so far. Well for the bigger part of it it seems to be a Windows related issue. the g.extension -l which I have used to check if r.in.lidar or r.in.pdal is installed returns either a runtime error or is silent. Furthermore the GRASS 7.7 contains again r.in.lidar while GRASS 7.4.1 relies on r.in.pdal.

Another problem seems to be related to the link2Gi packages which does not properly take the seleced version. So I have to sort this out first.

PaulScholefield commented 6 years ago

I reinstalled Gdal and checked r.in.pdal and r.in.lidar and both run successfully from the CLI.

dtm1 <- uavRst::pc2D_dtm(laspcFile = paste0(path_las,"lasdata.las"),

  • gisdbasePath = projRootDir,
  • tension = 20 ,
  • sampleGridSize = 25,
  • targetGridSize = 0.1,
  • giLinks = giLinks) :: create copy of the las file at the working directory... :: get extent of the point cloud You have more than one valid GRASS GIS version instDir version installation_type 1 C:\OSGeo4W64 grass-6.4.3 osgeo4W 2 C:\OSGeo4W64 grass-7.4.1 osgeo4W 3 C:\OSGeo4W64 grass-7.7.svn osgeo4W 4 C:\PROGRA~1\QGIS2~1.18 grass-7.0.5 osgeo4W

Please select one: 2 :: sampling minimum altitudes using : 25 meter grid size :: target grid size is 0.5 => setting grid size to: 0.5 :: create DTM by interpolation to a raster size of: 0.5 :: Resample to a grid size of: 0.5

This works and generates a DTM successfully!

But.....

dsm1 <- uavRst::pc2D_dsm(laspcFile = paste0(path_las,"lasdata.las"),

  • gisdbasePath = projRootDir,
  • sampleMethod = "max",
  • targetGridSize = 0.5,
  • giLinks = giLinks) :: create copy of the las file at the working directory... :: get extent of the point cloud :: link to GRASS You have more than one valid GRASS GIS version instDir version installation_type 1 C:\OSGeo4W64 grass-6.4.3 osgeo4W 2 C:\OSGeo4W64 grass-7.4.1 osgeo4W 3 C:\OSGeo4W64 grass-7.7.svn osgeo4W 4 C:\PROGRA~1\QGIS2~1.18 grass-7.0.5 osgeo4W

Please select one: 2 :: sampling max altitudes using : 0.5 meter grid size :: filling no data values if so Error in bin_gdal_info(rtmpfl11, to_int) : no such file: E:/Projects/Canopy_height/pc2D_dsm/PERMANENT/.tmp/unknown/dsm0.5 In addition: Warning messages: 1: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.in.lidar.exe --overwrite --quiet -o -e -n input=E:/Projects/Canopy_height/run/448000_318000_449999_99_319999_99.las output=dsm0.5 method=max pth=20 resolution=0.5' had status 884 2: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.info.exe -g map=dsm0.5' had status 1 3: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.info.exe -r map=dsm0.5' had status 1

Does not complete.

The DSM and DTM functions are slightly different, and possibly looking for r.in.pdal/r.inm.lidar is now messing things up.

Many thanks!

gisma commented 6 years ago

Thanks for reporting that this helps a lot.

gisma commented 6 years ago

@PaulScholefield in which version do you have installed what r.in function? As far as I have checked the r.in.pdal function is much more sensitive and running it under Windows I can not reproduce the results of the corresponding Linux installation. I will focus on r.in.lidar what means that it have to be installed by the user. I will setup during the next days a grass branch to deal with this development . Up to now I tried to fix this issue using r.in.lidar only. As far I have checked it runs with the current 7.5svn aka 7.7 and all older version than 7.4.1. Nevertheless running Windows it seems to be pretty tricky to setup all libraries correctly. Please check and feel free to give me any kind of feedback.

pls install the actual version of link2GI devtools::install_github("gisma/link2GI", ref = "master").

PaulScholefield commented 6 years ago

This is my installation script.

devtools::install_github("Jean-Romain/rlas", dependencies=TRUE, force = TRUE) devtools::install_github("Jean-Romain/lidR", dependencies=TRUE, force = TRUE) devtools::install_github("gisma/link2GI", ref = "master",dependencies =TRUE, force=TRUE) devtools::install_github("jannes-m/RQGIS",force = TRUE) devtools::install_github("AndyPL22/ForestTools",ref = "master",force = TRUE) devtools::install_github("gisma/uavRst", ref = "master", dependencies = TRUE, force = TRUE) devtools::install_github("be-marc/RSAGA", dependencies = TRUE, force = TRUE) install.packages(path_to_RQGIS_0.2.0.tar.gz, repos = NULL, type="source")

I also updated all packages, including gdal, which seemed to correct a lot of the errors, but took some time. Thanks for your efforts here. Will try again with 7.5svn

PaulScholefield commented 6 years ago

When I run pc2D_dsm I now get:

dsm1 <- uavRst::pc2D_dsm(laspcFile = paste0(path_las,"lasdata.las"),

  • gisdbasePath = projRootDir,
  • sampleMethod = "max",
  • targetGridSize = 0.5,
  • giLinks = giLinks) :: create copy of the las file at the working directory... :: get extent of the point cloud :: link to GRASS Error in rgrass7::initGRASS(gisBase = grass$gisbase_GRASS, home = tempdir(), :

rgrass7 is not compatible with the GRASS GIS version 'GRASS 6.4.3 (2013) '!

Please use the package appropriate to the GRASS GIS version:

GRASS GIS Version 5.x.y -- GRASS

GRASS GIS Version 6.x.y -- spgrass6

GRASS GIS Version 7.x.y -- rgrass7

gisma commented 6 years ago

Obviously you have installed a GRASS 6.4.3 version. link2GI is only setting up GRASS7.x As far as I know there should be no reason to take the old GRASS versions. Do you really need it? If not you should remove it. so you should specify the GRASS version you want to use. you can identify them by findGRASS() which gives you something like the following output:

findGRASS()
instDir version installation_type
1         /usr/lib/grass74   7.4.1           grass74
2 /usr/local/grass-7.7.svn 7.7.svn           grass77

If you want to select version 1 you may call the function as follows:

dsm <- pc2D_dsm(laspcFile = paste0(path_run,"lasdata.las"),
                gisdbasePath = projRootDir,
                sampleMethod = "max",
                targetGridSize = 0.5, 
                grassVersion = 1)
PaulScholefield commented 6 years ago

OK. Removed Grass 6. Updated all packages, and reinstalled Gdal.

findGRASS() instDir version installation_type 1 C:\OSGeo4W64 grass-7.4.1 osgeo4W 2 C:\OSGeo4W64 grass-7.7.svn osgeo4W 3 C:\PROGRA~1\QGIS2~1.18 grass-7.0.5 osgeo4W

dsm1 <- pc2D_dsm(laspcFile = paste0(path_las,"lasdata.las"),

  • gisdbasePath = projRootDir,
  • sampleMethod = "max",
  • targetGridSize = 1,
  • giLinks = giLinks,
  • grassVersion = 1) :: create copy of the las file at the working directory... :: get extent of the point cloud :: link to GRASS :: sampling max altitudes using : 1 meter grid size Error in bin_gdal_info(rtmpfl11, to_int) : no such file: E:/Projects/Canopy_height/pc2D_dsm/PERMANENT/.tmp/unknown/dsm1 In addition: Warning messages: 1: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.in.lidar.exe --overwrite --quiet -o input=E:/Projects/Canopy_height/run/448000_318000_449999_99_319999_99.las output=dsm1 method=max pth=20 resolution=1' had status 5 2: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.info.exe -g map=dsm1' had status 1 3: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.info.exe -r map=dsm1' had status 1

Strangely, pc2D_dtm is now failing too... with same error.

dtm1 <- uavRst::pc2D_dtm(laspcFile = paste0(path_las,"lasdata.las"),

  • gisdbasePath = projRootDir,
  • tension = 20 ,
  • sampleGridSize = 25,
  • targetGridSize = 0.1,
  • giLinks = giLinks) :: create copy of the las file at the working directory... :: get extent of the point cloud :: sampling minimum altitudes using : 25 meter grid size :: target grid size is 0.5 => setting grid size to: 0.5 :: create DTM by interpolation to a raster size of: 0.5 Error in bin_gdal_info(rtmpfl11, to_int) : no such file: E:/Projects/Canopy_height/pc2D_dtm/PERMANENT/.tmp/unknown/dtm In addition: Warning messages: 1: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.in.lidar.exe --overwrite --quiet -o -e -n input=E:/Projects/Canopy_height/run/448000_318000_449999_99_319999_99.las output=dem25 method=min resolution=25' had status 884 2: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.to.vect.exe --overwrite --quiet -z -b input=dem25 output=vdtm type=point' had status 1 3: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'v.surf.rst.exe --overwrite --quiet input=vdtm elevation=tdtm tension=20' had status 1 4: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.mapcalc.exe --overwrite --quiet expression="dtm = if(dem25 > 0 ,tdtm,0)"' had status 1 5: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.info.exe -g map=dtm' had status 1 6: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.info.exe -r map=dtm' had status 1
gisma commented 6 years ago

The errors (both) seems to be ok for GRASS7.4.x. Could you please (1) Please restart your R session and clean the environment (especially the hidden items) (2) try to set grassversion =2 (2) provide me the full script with all setting like projrootDir etc.?

PaulScholefield commented 6 years ago

Thanks, here is the script:

rm(list=ls()) Restarting R session...

rm(list=ls())

require(lidR) require(satelliteTools) library(rgdal) library(itcSegment) library(rlas) library(devtools) library(RQGIS) require(curl) require(ForestTools) require(gdalUtils) require(RSAGA) library(Rsagacmd) require(sf) require(sp) require(tools) require(rgrass7) require(uavRst) require(raster) require(mapview) require(link2GI)

linkSAGA() linkGRASS7() linkOTB() linkGDAL()

setwd("E:/Projects/Canopy_height")

projRootDir<-getwd()

paths<-link2GI::initProj(projRootDir = projRootDir, projFolders = c("data/","data/ref/","output/","run/","las/"), global = TRUE, pathprefix = "path")

pal = mapview::mapviewPalette("mapviewTopoColors") giLinks<-uavRst::linkAll()

dsm1 <- pc2D_dsm(laspcFile = paste0(path_las,"lasdata.las"), gisdbasePath = projRootDir, sampleMethod = "max", targetGridSize = 1, giLinks = giLinks, grassVersion = 2)

Output:

setwd("E:/Projects/Canopy_height")

projRootDir<-getwd()

paths<-link2GI::initProj(projRootDir = projRootDir,

  • projFolders = c("data/","data/ref/","output/","run/","las/"),
  • global = TRUE,
  • pathprefix = "path")

pal = mapview::mapviewPalette("mapviewTopoColors") giLinks<-uavRst::linkAll()

calculate DSM... convert raw DSM to GeoTiff fill no data... smoothing the gap filled DSM... calculate metadata ...

dsm1 <- pc2D_dsm(laspcFile = paste0(path_las,"lasdata.las"),

  • gisdbasePath = projRootDir,
  • sampleMethod = "max",
  • targetGridSize = 1,
  • giLinks = giLinks,
  • grassVersion = 2) create copy of the las file at the working directory... get extent of the point cloud link to GRASS sampling max altitudes using : 1 meter grid size

Error in bin_gdal_info(rtmpfl11, to_int) : no such file: E:/Projects/Canopy_height/pc2D_dsm/PERMANENT/.tmp/unknown/dsm1 In addition: Warning messages: 1: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.in.lidar.exe --overwrite --quiet -o input=E:/Projects/Canopy_height/run/448000_318000_449999_99_319999_99.las output=dsm1 method=max pth=20 resolution=1' had status 884 2: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.info.exe -g map=dsm1' had status 1 3: In system(syscmd, intern = intern, ignore.stderr = ignore.stderr, : running command 'r.info.exe -r map=dsm1' had status 1

gisma commented 6 years ago

Well this looks like a Gdal Windows Installation issue. I've used the updated cran version of link2gi a clean standalone Installation of Grass 7.5/7.7 Same with Saga and otb. Unfortunately i can not reproduce the Error. However using a "old grown" Windows System i am also running in this Gdal Error. I will try to get hold of the problem as soon as possible

PaulScholefield commented 6 years ago

Thanks very much, good luck!

gisma commented 4 years ago

Have re-implemented linkGDAL dropped the 'r_in_lidar due to the great lidR package there is no need for the very preliminary pdal libs. Should work now