R/qgis_meshexporttimeseries.R

Defines functions qgis_meshexporttimeseries

Documented in qgis_meshexporttimeseries

##' QGIS Algorithm provided by QGIS (native c++) Export time series values from points of a mesh dataset (native:meshexporttimeseries). Extracts a mesh dataset's time series values from points contained in a vector layer This algorithm extracts mesh's dataset time series values from points contained in a vector layer. If the time step is kept to its default value (0 hours), the time step used is the one of the two first datasets of the first selected dataset group.
##'
##' @title QGIS algorithm - Export time series values from points of a mesh dataset
##'
##' @param INPUT `mesh` - Input mesh layer. Path to a mesh layer.
##' @param DATASET_GROUPS `meshdatasetgroups` - Dataset groups. .
##' @param STARTING_TIME `meshdatasettime` - Starting time. .
##' @param FINISHING_TIME `meshdatasettime` - Finishing time. .
##' @param TIME_STEP `number` - Time step (hours). 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 INPUT_POINTS `source` - Points for data export. Path to a vector layer.
##' @param COORDINATES_DIGITS `number` - Digits count for coordinates. 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 DATASET_DIGITS `number` - Digits count for dataset value. 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 OUTPUT `fileDestination` - Exported data CSV file. Path for new file.
##' @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
##' * OUTPUT - outputFile - Exported data CSV file
##'
##'
##' @export
##' @md
##' @importFrom qgisprocess qgis_run_algorithm

qgis_meshexporttimeseries <- function(INPUT = qgisprocess:::qgis_default_value(), DATASET_GROUPS = qgisprocess:::qgis_default_value(), STARTING_TIME = qgisprocess:::qgis_default_value(), FINISHING_TIME = qgisprocess:::qgis_default_value(), TIME_STEP = qgisprocess:::qgis_default_value(), INPUT_POINTS = qgisprocess:::qgis_default_value(), COORDINATES_DIGITS = qgisprocess:::qgis_default_value(), DATASET_DIGITS = qgisprocess:::qgis_default_value(), OUTPUT = qgisprocess:::qgis_default_value(),..., .complete_output = .complete_output_option(), .quiet = .quiet_option(), .messages = .message_option()) {

  check_algorithm_necessities("native:meshexporttimeseries")

  if (.messages){
    output <- qgisprocess::qgis_run_algorithm("native:meshexporttimeseries", `INPUT` = INPUT, `DATASET_GROUPS` = DATASET_GROUPS, `STARTING_TIME` = STARTING_TIME, `FINISHING_TIME` = FINISHING_TIME, `TIME_STEP` = TIME_STEP, `INPUT_POINTS` = INPUT_POINTS, `COORDINATES_DIGITS` = COORDINATES_DIGITS, `DATASET_DIGITS` = DATASET_DIGITS, `OUTPUT` = OUTPUT,..., .quiet = .quiet)
  } else {
    suppressMessages(
      output <- qgisprocess::qgis_run_algorithm("native:meshexporttimeseries", `INPUT` = INPUT, `DATASET_GROUPS` = DATASET_GROUPS, `STARTING_TIME` = STARTING_TIME, `FINISHING_TIME` = FINISHING_TIME, `TIME_STEP` = TIME_STEP, `INPUT_POINTS` = INPUT_POINTS, `COORDINATES_DIGITS` = COORDINATES_DIGITS, `DATASET_DIGITS` = DATASET_DIGITS, `OUTPUT` = OUTPUT,..., .quiet = .quiet)
      )
  }

  if (.complete_output) {
    return(output)
  }
  else{
    qgisprocess::qgis_extract_output(output, "OUTPUT")
  }
}
JanCaha/r_package_qgis documentation built on May 1, 2024, 3:30 a.m.