R/sagang_angmap.R

Defines functions sagang_angmap

Documented in sagang_angmap

##' QGIS Algorithm provided by SAGA Next Gen Angmap (sagang:angmap). ---------------- Arguments ----------------  DEM: Elevation 	Argument type:	raster 	Acceptable values: 		- Path to a raster layer C: Dip grid (degrees)  (optional) 	Argument type:	raster 	Acceptable values: 		- Path to a raster layer D: Dip direction grid (degrees)  (optional) 	Argument type:	raster 	Acceptable values: 		- Path to a raster layer fB: Global structure dip (degrees) 	Default value:	45 	Argument type:	number 	Acceptable values: 		- A numeric value 		- field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field 		- expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression fC: Global structure dip direction (degrees) 	Default value:	90 	Argument type:	number 	Acceptable values: 		- A numeric value 		- field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field 		- expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression E: Angle 	Argument type:	rasterDestination 	Acceptable values: 		- Path for new raster layer F: CL dipdir 	Argument type:	rasterDestination 	Acceptable values: 		- Path for new raster layer G: CL dip 	Argument type:	rasterDestination 	Acceptable values: 		- Path for new raster layer
##'
##' @title QGIS algorithm - Angmap
##'
##' @param DEM `raster` - Elevation. Path to a raster layer.
##' @param C `raster` - Dip grid (degrees) . Path to a raster layer.
##' @param D `raster` - Dip direction grid (degrees) . Path to a raster layer.
##' @param fB `number` - Global structure dip (degrees). A numeric value. field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field. expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression.
##' @param fC `number` - Global structure dip direction (degrees). A numeric value. field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field. expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression.
##' @param E `rasterDestination` - Angle. Path for new raster layer.
##' @param F `rasterDestination` - CL dipdir. Path for new raster layer.
##' @param G `rasterDestination` - CL dip. Path for new raster layer.
##' @param ... further parameters passed to `qgisprocess::qgis_run_algorithm()`
##' @param .complete_output logical specifying if complete out of `qgisprocess::qgis_run_algorithm()` should be used (`TRUE`) or first output (most likely the main) should read (`FALSE`). Default value is `TRUE`.
##' @param .quiet logical specifying if parameter `.quiet` for `qgisprocess::qgis_run_algorithm()` Default value is `TRUE`.
##' @param .messages logical specifying if messages from `qgisprocess::qgis_run_algorithm()` should be printed (`TRUE`) or not (`FALSE`). Default value is `FALSE`.
##'
##' @details
##' ## Outputs description
##' * E - outputRaster - Angle
##' * F - outputRaster - CL dipdir
##' * G - outputRaster - CL dip
##'
##'
##' @export
##' @md
##' @importFrom qgisprocess qgis_run_algorithm

sagang_angmap <- function(DEM = qgisprocess:::qgis_default_value(), C = qgisprocess:::qgis_default_value(), D = qgisprocess:::qgis_default_value(), fB = qgisprocess:::qgis_default_value(), fC = qgisprocess:::qgis_default_value(), E = qgisprocess:::qgis_default_value(), F = qgisprocess:::qgis_default_value(), G = qgisprocess:::qgis_default_value(),..., .complete_output = .complete_output_option(), .quiet = .quiet_option(), .messages = .message_option()) {

  check_algorithm_necessities("sagang:angmap")

  if (.messages){
    output <- qgisprocess::qgis_run_algorithm("sagang:angmap", `DEM` = DEM, `C` = C, `D` = D, `fB` = fB, `fC` = fC, `E` = E, `F` = F, `G` = G,..., .quiet = .quiet)
  } else {
    suppressMessages(
      output <- qgisprocess::qgis_run_algorithm("sagang:angmap", `DEM` = DEM, `C` = C, `D` = D, `fB` = fB, `fC` = fC, `E` = E, `F` = F, `G` = G,..., .quiet = .quiet)
      )
  }

  if (.complete_output) {
    return(output)
  }
  else{
    qgisprocess::qgis_extract_output(output, "E")
  }
}
JanCaha/r_package_qgis documentation built on July 6, 2024, 3:05 p.m.