|
|
@@ -0,0 +1,24 @@
|
|
|
+#' 'qgisprocess' funktsiooonides GPKG INPUT/OUTPUT konstrueerimine Postgresql salvestamiseks
|
|
|
+#'
|
|
|
+#' See funktsioon konstrueerib 'qgisprocess' funktsioonides enamasti INPUT/OUTPUT/OVERLAY parameetri argumentide kasutatava fraasi, mis on vajalik postgresql andmebaasiga ühendamisegs.
|
|
|
+#' @param conf A list() of configuration variables. Default values \code{\link[ruut]{get_config}}.
|
|
|
+#' @seealso [ruut::db_connect()], [ruut::get_config()], [ruut::construct_ogr2ogr_PG_connect_str()], [ruut::construct_qgis_output_result_to_beter_format()],[ruut::construct_to_gpkg_output_file_str()]
|
|
|
+#' @return A string "postgres://dbname='%s' host=%s port=%s user='%s' password='%s' sslmode=%s key='id' srid=3301 checkPrimaryKeyUnicity='1' table=\"%s\".\"%s\" (geometry)".
|
|
|
+#' @seealso [ruut::construct_ogr2ogr_PG_connect_str()], [ruut::construct_qgis_output_result_to_beter_format()]
|
|
|
+#' @keywords gpkg
|
|
|
+#' @export
|
|
|
+#' @examples
|
|
|
+#'
|
|
|
+#' \dontrun{
|
|
|
+#'
|
|
|
+#' conf <- ruut::get_config()
|
|
|
+#' construct_to_gpkg_output_postgres_str(conf = NULL)
|
|
|
+#' }
|
|
|
+construct_to_gpkg_output_postgres_str <- function(conf = NULL) {
|
|
|
+ if (is.null(conf)) conf <- ruut::get_config()
|
|
|
+ PG <- sprintf(
|
|
|
+ 'postgres://dbname=\'%s\' host=%s port=%s user=\'%s\' password=\'%s\' sslmode=%s key=\'id\' srid=3301 checkPrimaryKeyUnicity=\'1\' table=\"%s\".\"%s\" (geometry)',
|
|
|
+ conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, conf$table
|
|
|
+ )
|
|
|
+ PG
|
|
|
+}
|