Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
MiKatt committed Jan 27, 2017
1 parent 94aa281 commit 20aaf09
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
7 changes: 4 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ A functional installation of [GRASS GIS (>=7.0)](https://grass.osgeo.org/#) with
[r.hydrodem](https://grass.osgeo.org/grass70/manuals/addons/r.hydrodem.html) is needed.
These add-ons can be installed from within GRASS using the console and g.extension or in the GUI under 'Settings'/'Addons extensions'/'Install extensions from add-ons' under 'raster'.

**UPDATE!!**
```{r install, eval=FALSE}
install.packages("devtools")
# install.packages("devtools")
devtools::install_github("MiKatt/openSTARS")
library("openSTARS")
```
Expand Down Expand Up @@ -176,6 +175,7 @@ plot(dem, col = terrain.colors(20))
lines(edges, col = "blue")
points(sites_orig, pch = 21, cex=0.75, bg = "grey")
points(sites, pch = 20, col = "black")
legend(x=par("usr")[1]*1.002, y = par("usr")[3]*1.01,, col = 1, pt.bg = "grey", pch = c(21, 19), legend = c("original sites","snapped sites"))
```

### Prepare prediction sites
Expand Down Expand Up @@ -204,7 +204,8 @@ edges <- readVECT("edges", ignore.stderr = TRUE)
plot(dem, col = terrain.colors(20))
lines(edges, col = "blue")
points(sites, pch = 21, cex=0.75, bg = "grey")
points(pred_sites, pch = 20, col = "black")
points(pred_sites, pch = 21, cex=0.75, bg = "royalblue")
legend(x=par("usr")[1]*1.002, y = par("usr")[3]*1.01, pt.bg = c("grey","royalblue"), pch = 21, legend = c("observation sites","prediction sites"))
head(pred_sites@data)
```

Expand Down
21 changes: 8 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ A functional installation of [GRASS GIS (>=7.0)](https://grass.osgeo.org/#) with
[r.hydrodem](https://grass.osgeo.org/grass70/manuals/addons/r.hydrodem.html) is needed.
These add-ons can be installed from within GRASS using the console and g.extension or in the GUI under 'Settings'/'Addons extensions'/'Install extensions from add-ons' under 'raster'.

**UPDATE!!**

```r
install.packages("devtools")
Expand All @@ -36,9 +35,9 @@ library(openSTARS)
initGRASS(gisBase = "/usr/lib/grass72/",
home = tempdir(),
override = TRUE)
#> gisdbase /tmp/RtmpPE5rka
#> location file3069678f9266
#> mapset file306975285640
#> gisdbase /tmp/RtmpnD1smI
#> location file32726bf2a140
#> mapset file327258b44318
#> rows 1
#> columns 1
#> north 1
Expand Down Expand Up @@ -213,6 +212,7 @@ plot(dem, col = terrain.colors(20))
lines(edges, col = "blue")
points(sites_orig, pch = 21, cex=0.75, bg = "grey")
points(sites, pch = 20, col = "black")
legend(x=par("usr")[1]*1.002, y = par("usr")[3]*1.01,, col = 1, pt.bg = "grey", pch = c(21, 19), legend = c("original sites","snapped sites"))
```

![](README_files/figure-html/plot_data3-1.png)<!-- -->
Expand Down Expand Up @@ -248,7 +248,8 @@ edges <- readVECT("edges", ignore.stderr = TRUE)
plot(dem, col = terrain.colors(20))
lines(edges, col = "blue")
points(sites, pch = 21, cex=0.75, bg = "grey")
points(pred_sites, pch = 20, col = "black")
points(pred_sites, pch = 21, cex=0.75, bg = "royalblue")
legend(x=par("usr")[1]*1.002, y = par("usr")[3]*1.01, pt.bg = c("grey","royalblue"), pch = 21, legend = c("observation sites","prediction sites"))
```

![](README_files/figure-html/plot_data4-1.png)<!-- -->
Expand All @@ -274,7 +275,7 @@ For the approximate calculation, first attributes must be intersected with the s


```r
# calculates slope from DEM as an example attribute
# calculate slope from DEM as an example attribute
execGRASS("r.slope.aspect", flags = c("overwrite","quiet"),
parameters = list(
elevation = "dem",
Expand Down Expand Up @@ -311,12 +312,6 @@ The exact calculation of attribute values for the total catchment of each point


```r
# calculates slope from DEM as an example attribute
execGRASS("r.slope.aspect", flags = c("overwrite","quiet"),
parameters = list(
elevation = "dem",
slope = "slope"
))
# calculate exact catchment area and average slope per catchment of each site
calc_attributes_sites_exact(sites_map = "sites",
input_raster = "slope",
Expand All @@ -328,7 +323,7 @@ calc_attributes_sites_exact(sites_map = "sites",
#> v.out.ogr complete. 87 features (Point type) written to <sites> (SQLite
#> format).
#> OGR data source with driver: SQLite
#> Source: "/tmp/RtmpPE5rka/file3069678f9266/PERMANENT/.tmp/mira-Linux/629.0", layer: "sites"
#> Source: "/tmp/RtmpnD1smI/file32726bf2a140/PERMANENT/.tmp/mira-Linux/680.0", layer: "sites"
#> with 87 features
#> It has 15 fields
sites <- readVECT("sites", ignore.stderr = TRUE)
Expand Down
Binary file modified README_files/figure-html/plot_data3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified README_files/figure-html/plot_data4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 20aaf09

Please sign in to comment.