|
|
@@ -19,36 +19,13 @@
|
|
|
#' qgis_algorithm_search_by_word(str = "filedownloader")
|
|
|
#' qgis_algorithm_search_by_word(str = "")
|
|
|
#' qgis_algorithm_search_by_word()
|
|
|
-#'
|
|
|
#' }
|
|
|
qgis_algorithm_search_by_word <- function(str = NULL) {
|
|
|
if (is.null(str) || str == "") {
|
|
|
return(NULL)
|
|
|
}
|
|
|
- algs <- qgisprocess::qgis_algorithms(query = FALSE, quiet = TRUE)
|
|
|
- ids <- grep(str, algs$algorithm)
|
|
|
- algs.id <- methods::cbind2(ids, algs[ids, ])
|
|
|
- colnames(algs.id) <- c("id", colnames(algs))
|
|
|
- print(algs.id)
|
|
|
- i <- 1
|
|
|
- # Juhendi näitamine
|
|
|
- if (nrow(algs.id) > 1) {
|
|
|
- while (T) {
|
|
|
- num <- readline(sprintf(
|
|
|
- "Millist juhendit soovid vaadata (%s)? > ",
|
|
|
- paste(seq(1:nrow(algs.id)), collapse = ",")
|
|
|
- ))
|
|
|
- num <- as.numeric(num)
|
|
|
- if (num %in% seq(1:nrow(algs.id))) {
|
|
|
- i <- num
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- qgisprocess::qgis_show_help(algs.id[i, "algorithm"])
|
|
|
+ x <- system(sprintf("qgis_process list | grep %s", str), intern = TRUE)
|
|
|
+ x <- do.call("rbind", strsplit(x, "\t"))[, 2:3]
|
|
|
cat("\n----------------\n")
|
|
|
- cat("\nValitud algoritm:\n")
|
|
|
- cat(algs.id[i, "algorithm"])
|
|
|
- cat("\n\n----------------\n")
|
|
|
- cat("\n\n")
|
|
|
+ x
|
|
|
}
|