Jelajahi Sumber

Muudetud 'gpkg_sellest_alustame_gpkg_loomist'.

Ardo Kubjas 5 tahun lalu
induk
melakukan
866ad03fe8

+ 1 - 1
R/construct_to_gpkg_output_file_str.R

@@ -15,7 +15,7 @@
 #' conf$gpkg_home <- "/data/gpkg/artiklid/artikkel_210127_valga_matsalu_lahemaa"
 #' conf$gpkg_file <- "matsalu"
 #' conf$gpkg_table <- "piir"
-#' input <- ruut::construct_to_gpkg_output_postgres_str(
+#' input <- ruut::construct_to_gpkg_output_file_str(
 #'   conf = conf, is_input_str = TRUE
 #' )
 #' conf$gpkg_home <- "/data/gpkg/artiklid/artikkel_210127_valga_matsalu_lahemaa"

+ 5 - 14
R/gpkg_sellest_alustame_gpkg_loomist.R

@@ -70,22 +70,13 @@ gpkg_sellest_alustame_gpkg_loomist <- function(pk = NULL, obj = NULL, gpkg_home
   hspacing <- (ceiling((pk_attributes$bbox["xmax"] / 100)) * 100) - (round((pk_attributes$bbox["xmin"] / 100), digits = 0) * 100)
   vspacing <- (ceiling((pk_attributes$bbox["ymax"] / 100)) * 100) - (round((pk_attributes$bbox["ymin"] / 100), digits = 0) * 100)
   conf$gpkg_table <- "bb"
-  output <- ruut::construct_to_gpkg_output_file_str(conf = conf)
+  output <- ruut::construct_to_gpkg_output_file_str(conf = conf, is_input_str = F)
   # ruut::qgis_algorithm_search_by_word(str = "grid")
   algorithm <- "native:creategrid"
-  # cat(qgisprocess::qgis_show_help(algorithm = algorithm))
-  result <- qgisprocess::qgis_run_algorithm(
-    algorithm = algorithm,
-    CRS = "EPSG:3301",
-    EXTENT = extent,
-    HOVERLAY = 0,
-    HSPACING = hspacing,
-    TYPE = 2,
-    VOVERLAY = 0,
-    VSPACING = vspacing,
-    OUTPUT = output
-    # .quiet = TRUE
-  )
+  # cat(ruut::qgis_show_help(algorithm = algorithm))
+  cmd <- sprintf("qgis_process run %s --CRS=\"EPSG:3301\" --EXTENT=\"%s\" --HOVERLAY=0 --HSPACING=%s --TYPE=2 --VOVERLAY=0 --VSPACING=%s --OUTPUT=\"%s\"", algorithm, extent, hspacing, vspacing, output)
+  cat(sprintf("\n%s\n", cmd))
+  system(cmd)
   # Layers list
   sf::st_layers(dsn = dsn)
 }

+ 1 - 1
man/construct_to_gpkg_output_file_str.Rd

@@ -30,7 +30,7 @@ conf <- ruut::get_config()
 conf$gpkg_home <- "/data/gpkg/artiklid/artikkel_210127_valga_matsalu_lahemaa"
 conf$gpkg_file <- "matsalu"
 conf$gpkg_table <- "piir"
-input <- ruut::construct_to_gpkg_output_postgres_str(
+input <- ruut::construct_to_gpkg_output_file_str(
   conf = conf, is_input_str = TRUE
 )
 conf$gpkg_home <- "/data/gpkg/artiklid/artikkel_210127_valga_matsalu_lahemaa"