qgis_algorithm_search_by_word.R 929 B

123456789101112131415161718192021222324252627282930
  1. #' QGIS-i algoritmi leidmine fraasi järele
  2. #'
  3. #' Funktsioon leiab fraasi järele QGIS-i algoritmid.
  4. #' @param str string otsitav algoritmi fraas.
  5. #' @return Table found algorithms. Help for the selected algorithm.
  6. #' @return A array of all database schemas.
  7. #' @keywords qgis, help
  8. #' @export
  9. #' @examples
  10. #' \dontrun{
  11. #'
  12. #' qgis_algorithm_search_by_word(str = "clip")
  13. #' algorithm <- "native:clip"
  14. #' # Read help.
  15. #' ruut::qgis_show_help(algorithm = algorithm)
  16. #'
  17. #' qgis_algorithm_search_by_word(str = "centroid")
  18. #' qgis_algorithm_search_by_word(str = "filedownloader")
  19. #' qgis_algorithm_search_by_word(str = "")
  20. #' qgis_algorithm_search_by_word()
  21. #' }
  22. qgis_algorithm_search_by_word <- function(str = NULL) {
  23. if (is.null(str) || str == "") {
  24. return(NULL)
  25. }
  26. x <- system(sprintf("qgis_process list | grep %s", str), intern = TRUE)
  27. x <- do.call("rbind", strsplit(x, "\t"))[, 2:3]
  28. cat("\n----------------\n")
  29. x
  30. }