R package for mapping wetland ecosystems using data driven R statistical methods like Random Forests and open source GIS.
This package (in development) provides tools for running the ModelMap::model.build
and ModelMap::model.mapmake
R functions, specifically for modeling and mapping wetland ecosystems. Additional functions help generate the necessary input training data and raster look up table inputs.
Wetland models can be run using area of interest polygons, restricting output to specific drainage basins, for example.
wetlandmapR depends on RSAGA for some raster processing. RSAGA depends on SAGA GIS being installed and accessible on your computer. Please see the RSAGA documentation for instructions on how to do this. Optionally, if the user wishes to attribute upstream basin statistics to provided pour points GRASS-GIS version 7.6.0 or higher must also be installed in addition to the rgrass7 R package.
Creates raster derivatives (products) from an input Digital Elevation Model (DEM) using SAGA-GIS.
Aligns input raster(s) to a target raster so that extent, cell size, and cell origin are the same, returning a RasterStack object.
Adds cell values from a Raster object as attributes to a SpatialPoints object.
This function runs ModelMap::model.build
to build a wetland model using training data attributed with predictor values.
This function runs ModelMap::model.mapmake
to generate raster prediction surfaces using model output from wetland_model
.
This function reads in classified raster values and creates polygons from contiguous cell values, these polygons are then simplified.
This function initializes a GRASS-GIS environment using the rgrass7 package in order to calculate upstream basin statistics of user provided pour points of interest.
This function assumes set_grass_env
has been called. This function attributes upstream basin statistics calculated from provided input raster layers for specified pour point locations.
Get the latest version from GitHub with:
devtools::install_github("bcgov/wetlandmapR")
Download a Docker image based on rocker/geospatial:3.6.3 with all the required dependencies and packages pre-installed with:
docker pull huntgdok/wetlandmapr:latest
The image can then be run by passing the command:
docker run -e PASSWORD=URPassword -p 8787:8787 --rm huntgdok/wetlandmapr:latest
Where URPassword
is any password of your choice, and username rstudio
. The running container can be viewed by passing localhost to your browser. Be sure to copy all outputs locally before exiting as all data will be lost.
See the example vignette which describes wetlandmapR_example how to use the functions in this package together for mapping wetlands.