Skip to content

Commit

Permalink
Check plugins are installed, close geocompx#960
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed May 6, 2023
1 parent 517d515 commit 3cdb299
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions 10-gis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ library(gdalcubes)
```

```{r 09-gis-1-3, echo=FALSE}
# Only run code if qgis is installed
# Only run code if qgis and relevant plugins are installed
has_qgis = FALSE
qgisprocess_installed = "qgisprocess" %in% installed.packages()
if(qgisprocess_installed) {
algs = qgisprocess::qgis_algorithms()
if(!is.null(algs)) {
if(nrow(algs) > 300) {
qgis_enable_plugins()
has_saga = any(grepl("saga", algs$provider))
has_grass = any(grepl("grass", algs$provider))
if(has_grass && has_saga) {
has_qgis = TRUE
}
}
Expand Down

0 comments on commit 3cdb299

Please sign in to comment.