This repository has been archived by the owner on Apr 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
/
known_issues.Rmd
115 lines (100 loc) · 4.68 KB
/
known_issues.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
## Known (R)QGIS problems
- `grass7:r.viewshed()` does not work under Linux (under Windows it does...)
```{r, eval = FALSE}
library("RQGIS")
data("dem")
data("random_points")
find_algorithms("viewshed")
alg <- "grass7:r.viewshed"
get_usage(alg)
open_help(alg)
# let's find out about the default values
get_args_man(alg)
point <- random_points[sample(1:nrow(random_points), 1), ]
coord <- paste(sf::st_coordinates(point), collapse = ",")
out <- run_qgis(alg, input = dem, coordinates = coord,
output = "out.tif", load_output = TRUE)
# under Linux you might not get an output (I think we should file a bug...)
```
Works also under Linux using QGIS 2.18.22 in conjunction with GRASS GIS 7.4.1.
- `grass7:r.watershed()`: The algorithm is executed sucessfully but no output is produced though QGIS tells otherwise (issue #81).
```{r, eval = FALSE}
library("RQGIS")
data("dem")
run_qgis("grass7:r.watershed", drainage = "drain.tif", elevation = dem,
load_output = TRUE)
```
<!--
- `qgis:intersection()` produces under Linux the same result when running twice with different input layers. Under Windows it works (issue #74). The problem is resolved when using the unlock-branch, i.e., when explicitly loading and registering spatial objects in QGIS (see `?qgis_load_geom()`) as well as unregistering the objects after the successful geoprocessing (internally done in `run_qgis()`).
```{r, eval = FALSE}
library("sp")
library("sf")
crds <- cbind(x=c(0, 0, 400, 400, 0), y=c(0, 400, 400, 0, 0))
Pl <- Polygon(crds)
ID <- "1"
Pls <- Polygons(list(Pl), ID=ID)
SPls <- SpatialPolygons(list(Pls))
df <- data.frame(value=1, row.names=ID)
SPDF1 <- SpatialPolygonsDataFrame(SPls, df)
crds <- cbind(x=c(0, 0, 400, 400, 0), y=c(0, 400, 400, 0, 0)) - 200
Pl <- Polygon(crds)
ID <- "2"
Pls <- Polygons(list(Pl), ID=ID)
SPls <- SpatialPolygons(list(Pls))
df <- data.frame(value=1, row.names=ID)
SPDF2 <- SpatialPolygonsDataFrame(SPls, df)
crds <- cbind(x=c(0, 0, 400, 400, 0), y=c(0, 400, 400, 0, 0)) + 200
Pl <- Polygon(crds)
ID <- "3"
Pls <- Polygons(list(Pl), ID=ID)
SPls <- SpatialPolygons(list(Pls))
df <- data.frame(value=1, row.names=ID)
SPDF3 <- SpatialPolygonsDataFrame(SPls, df)
# RQGIS::set_env("/Applications/QGIS.app")
# set_env()
plot(st_geometry(st_as_sf(SPDF1)), xlim = c(-400, 400), ylim = c(-400, 600))
plot(st_geometry(st_as_sf(SPDF2)), add = TRUE)
plot(st_geometry(st_as_sf(SPDF3)), add = TRUE)
test1 <- RQGIS::run_qgis("qgis:intersection", INPUT = SPDF1, INPUT2 = SPDF2,
OUTPUT = file.path(tempdir(), "test1.shp"),
load_output = TRUE)
plot(st_geometry(test1), add = TRUE, col = "red")
test2 <- RQGIS::run_qgis("qgis:intersection", INPUT = SPDF1, INPUT2 = SPDF3,
OUTPUT = file.path(tempdir(), "test2.shp"),
load_output = TRUE)
plot(st_geometry(test2), add = TRUE, col = "blue")
identical(test1, test2)
```
-->
- `saga:gridbuffer()`: Following example works under Windows with QGIS 2.14 and SAGA 2.1.2 but not with QGIS 2.18 and SAGA 2.3.2
```{r, eval = FALSE}
set_env(dev = FALSE)
data(dem)
out = run_qgis(alg = "saga:gridbuffer", FEATURES = dem,
BUFFERTYPE = "1",
DIST = "1", load_output = TRUE)
```
- `grass7:v.rast.stats()` does not add univariate statistics columns (QGIS 2.18; see #99). Try it also with QGIS3.
```{r, eval = FALSE}
library(RQGIS)
library(spData)
library(spDataLarge)
library(sf)
library(raster)
library(dplyr)
# load the data -----------------------------------------------------------
srtm = raster((system.file("raster/srtm.tif", package = "spDataLarge")))
zion = st_read((system.file("vector/zion.gpkg", package = "spDataLarge"))) %>%
st_transform(4326)
# grass7 ------------------------------------------------------------------
# https://grass.osgeo.org/grass74/manuals/v.rast.stats.html
set_env(dev = FALSE)
alg = "grass7:v.rast.stats"
get_usage(alg)
tmp = run_qgis(alg,
map = zion,
raster = srtm,
column_prefix = "new_",
output = file.path(tempdir(), "new_zion.shp"),
load_output = TRUE)
```