Przeglądaj źródła

Muudetud 'gtfs'.

Ardo Kubjas 5 lat temu
rodzic
commit
34491ac23b
1 zmienionych plików z 4 dodań i 12 usunięć
  1. 4 12
      R/gtfs.R

+ 4 - 12
R/gtfs.R

@@ -119,7 +119,7 @@ gtfs <- function(conf = NULL) {
           # Algoritmi juhend!
           # qgis_algorithm_search_by_word(str = "pointstopath")
           algorithm <- "qgis:pointstopath"
-          # cat(qgis_show_help(algorithm = algorithm))
+          # ruut::qgis_show_help(algorithm = algorithm)
           # Run algorithm.
           output <- sprintf(
             'postgres://dbname=\'%s\' host=%s port=%s user=\'%s\' sslmode=%s password=\'%s\' table=\"%s\".\"%s\" (geom)',
@@ -131,17 +131,9 @@ gtfs <- function(conf = NULL) {
             conf$dbname, conf$host, conf$port, conf$user, conf$sslmode, conf$password,
             conf$schema, conf$table
           )
-          result <- qgisprocess::qgis_run_algorithm(
-            algorithm = algorithm,
-            CLOSE_PATH = 0,
-            DATE_FORMAT = "",
-            GROUP_FIELD = "shape_id",
-            INPUT = input,
-            ORDER_FIELD = "shape_pt_sequence",
-            OUTPUT_TEXT_DIR = "/tmp/",
-            OUTPUT = output,
-            .quiet = TRUE
-          )
+          str <- sprintf("{ 'INPUT' : '%s', 'OUTPUT' : '%s' , 'CLOSE_PATH' : 0 , DATE_FORMAT : '', GROUP_FIELD : 'shape_id', ORDER_FIELD : 'shape_pt_sequence', OUTPUT_TEXT_DIR : '/tmp/' }", input, output)
+          cmd <- ruut::construct_qgis_output_result_to_better_format(str = str, algorithm = algorithm)
+          system(cmd)
         } else {
           cmd <- sprintf(
             paste0(