R/sagang_singlecoordinatetransformation.R

Defines functions sagang_singlecoordinatetransformation

Documented in sagang_singlecoordinatetransformation

##' QGIS Algorithm provided by SAGA Next Gen Single coordinate transformation (sagang:singlecoordinatetransformation). ---------------- Arguments ----------------  SOURCE_CRS: Proj4 Parameters 	Default value:	+proj=longlat +datum=WGS84 	Argument type:	string 	Acceptable values: 		- String 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 SOURCE_X: X 	Default value:	0 	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 SOURCE_Y: Y 	Default value:	0 	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 TARGET_CRS: Proj4 Parameters 	Default value:	+proj=longlat +datum=WGS84 	Argument type:	string 	Acceptable values: 		- String 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 TARGET_X: X 	Default value:	0 	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 TARGET_Y: Y 	Default value:	0 	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
##'
##' @title QGIS algorithm - Single coordinate transformation
##'
##' @param SOURCE_CRS `string` - Proj4 Parameters. String 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 SOURCE_X `number` - X. 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 SOURCE_Y `number` - Y. 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 TARGET_CRS `string` - Proj4 Parameters. String 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 TARGET_X `number` - X. 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 TARGET_Y `number` - Y. 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 ... 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
##' No output description provided.
##'
##'
##' @export
##' @md
##' @importFrom qgisprocess qgis_run_algorithm

sagang_singlecoordinatetransformation <- function(SOURCE_CRS = qgisprocess:::qgis_default_value(), SOURCE_X = qgisprocess:::qgis_default_value(), SOURCE_Y = qgisprocess:::qgis_default_value(), TARGET_CRS = qgisprocess:::qgis_default_value(), TARGET_X = qgisprocess:::qgis_default_value(), TARGET_Y = qgisprocess:::qgis_default_value(),..., .complete_output = .complete_output_option(), .quiet = .quiet_option(), .messages = .message_option()) {

  check_algorithm_necessities("sagang:singlecoordinatetransformation")

  if (.messages){
    output <- qgisprocess::qgis_run_algorithm("sagang:singlecoordinatetransformation", `SOURCE_CRS` = SOURCE_CRS, `SOURCE_X` = SOURCE_X, `SOURCE_Y` = SOURCE_Y, `TARGET_CRS` = TARGET_CRS, `TARGET_X` = TARGET_X, `TARGET_Y` = TARGET_Y,..., .quiet = .quiet)
  } else {
    suppressMessages(
      output <- qgisprocess::qgis_run_algorithm("sagang:singlecoordinatetransformation", `SOURCE_CRS` = SOURCE_CRS, `SOURCE_X` = SOURCE_X, `SOURCE_Y` = SOURCE_Y, `TARGET_CRS` = TARGET_CRS, `TARGET_X` = TARGET_X, `TARGET_Y` = TARGET_Y,..., .quiet = .quiet)
      )
  }

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