|
|
@@ -84,11 +84,21 @@ minu_teed_riigiteed <- function(conf = NULL) {
|
|
|
system(cmd)
|
|
|
cat(sprintf("\n-------------\nLoodi andmebaas '%s'.\n", output))
|
|
|
|
|
|
- ## ------------------ 3.2 Copy temp gpkg file to postgis ---------------------
|
|
|
+ ## ------------------- 3.2 Eemaldame ebavajalikud veerud ---------------------
|
|
|
+ # ruut::qgis_algorithm_search_by_word("retain")
|
|
|
+ algorithm <- "native:retainfields"
|
|
|
+ # ruut::qgis_show_help(algorithm = algorithm)
|
|
|
+ input <- vars$tmp_gpkg_file_input_4
|
|
|
+ output <- vars$tmp_gpkg_file_output_5
|
|
|
+ cmd <- sprintf("qgis_process run %s --FIELDS='tyyp' --FIELDS='tyyp_t' --FIELDS='tee' --FIELDS='nimetus' --INPUT='%s' --OUTPUT='%s' ", algorithm, input, output)
|
|
|
+ system(cmd)
|
|
|
+ cat(sprintf("\n-------------\nLoodi andmebaas '%s'.\n", output))
|
|
|
+
|
|
|
+ ## ------------------ 3.3 Copy temp gpkg file to postgis ---------------------
|
|
|
conf$schema <- "minu_teed"
|
|
|
conf$table <- "teedevork_riigiteed_p"
|
|
|
PG <- ruut::construct_ogr2ogr_PG_connect_str(conf = conf)
|
|
|
- cmd <- sprintf("ogr2ogr -progress --config PG_USE_COPY YES -f PostgreSQL %s -lco DIM=2 %s %s -overwrite -nlt %s -lco GEOMETRY_NAME=geom -lco FID=fid -nln %s.%s -nlt PROMOTE_TO_MULTI", PG, vars$tmp_gpkg_file, vars$layer_4, "POINT", conf$schema, conf$table)
|
|
|
+ cmd <- sprintf("ogr2ogr -progress --config PG_USE_COPY YES -f PostgreSQL %s -lco DIM=2 %s %s -overwrite -nlt %s -lco GEOMETRY_NAME=geom -lco FID=id -nln %s.%s -nlt PROMOTE_TO_MULTI", PG, vars$tmp_gpkg_file, vars$layer_5, "POINT", conf$schema, conf$table)
|
|
|
system(cmd)
|
|
|
cat(sprintf("\n-------------\nLoodi andmebaas '%s'.\n", conf$table))
|
|
|
}
|