geometry_type = "PROMOTE_TO_MULTI" cmd <- sprintf( paste0( "export PGCLIENTENCODING=ISO-8859-4; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING ISO-8859-4 -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) cmd <- sprintf( paste0( "export PGCLIENTENCODING=ISO-8859-4; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING ISO-8859-4 -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) paste0( "export PGCLIENTENCODING=ISO-8859-4; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING ISO-8859-4 -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ) cmd <- sprintf( paste0( "export PGCLIENTENCODING=ISO-8859-4; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING ISO-8859-4 -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) conf$dbname conf$host conf$port conf$user conf$password conf$sslmode conf$schema source source <- sprintf('"%s" "%s"', tmp_dir_kihid, tbl_names[i]) source source cmd <- sprintf( paste0( "export PGCLIENTENCODING=ISO-8859-4; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING ISO-8859-4 -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) cmd system(cmd) conf$table print(tbl_names[i]) conf$table <- tolower(tbl_names[i]) source <- sprintf('"%s" "%s"', tmp_dir_kihid, tbl_names[i]) ## Export to postgis database. conf$primary_key = 'id' conf$s_srs = "EPSG:3301" conf$t_srs = "EPSG:3301" geometry_type = "PROMOTE_TO_MULTI" # ruut::copy_shp_to_db( # dir = tmp_dir_kihid, layer = tbl_names[i], conf = conf, # id = "id", crs_source = "EPSG:3301", crs_target = "EPSG:3301", # geometry_type = "PROMOTE_TO_MULTI" # ) cmd <- sprintf( paste0( "export PGCLIENTENCODING=ISO-8859-4; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING ISO-8859-4 -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) cat(sprintf( "\nShp fail %s kopeeriti POSTGIS andmebaasi %s.%s\n\n", ls[i], conf$schema, conf$table )) cmd <- sprintf( paste0( "export PGCLIENTENCODING=ISO-8859-4; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING UTF-8 -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) cmd <- sprintf( paste0( "export PGCLIENTENCODING=UTF-8; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING UTF-8 -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) styler:::style_active_file() library(estmap) encoding <- 'UTF-8' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) cmd tbl_names i = 33 print(tbl_names[i]) conf$table <- tolower(tbl_names[i]) source <- sprintf('"%s" "%s"', tmp_dir_kihid, tbl_names[i]) ## Export to postgis database. conf$primary_key <- "id" conf$s_srs <- "EPSG:3301" conf$t_srs <- "EPSG:3301" geometry_type <- "PROMOTE_TO_MULTI" encoding <- 'UTF-8' encoding <- 'CP1257' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) # Unzip utils::unzip(saveTo, overwrite = T, exdir = tmp_dir) print(tbl_names[i]) conf$table <- tolower(tbl_names[i]) source <- sprintf('"%s" "%s"', tmp_dir_kihid, tbl_names[i]) ## Export to postgis database. conf$primary_key <- "id" conf$s_srs <- "EPSG:3301" conf$t_srs <- "EPSG:3301" geometry_type <- "PROMOTE_TO_MULTI" encoding <- 'UTF-8' encoding <- 'CP1257' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) encoding <- 'ISO-8859-4' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) encoding <- 'ISO-8859-4' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) encoding <- 'ISO-8859-4' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s -skipfailures" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) encoding <- 'UTF-8' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s -skipfailures" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) tbl_names i=15 print(tbl_names[i]) conf$table <- tolower(tbl_names[i]) source <- sprintf('"%s" "%s"', tmp_dir_kihid, tbl_names[i]) ## Export to postgis database. conf$primary_key <- "id" conf$s_srs <- "EPSG:3301" conf$t_srs <- "EPSG:3301" geometry_type <- "PROMOTE_TO_MULTI" encoding <- 'UTF-8' # encoding <- 'ISO-8859-4' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s -skipfailures" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) tbl_names i = 41 print(tbl_names[i]) conf$table <- tolower(tbl_names[i]) source <- sprintf('"%s" "%s"', tmp_dir_kihid, tbl_names[i]) ## Export to postgis database. conf$primary_key <- "id" conf$s_srs <- "EPSG:3301" conf$t_srs <- "EPSG:3301" geometry_type <- "PROMOTE_TO_MULTI" encoding <- 'UTF-8' # encoding <- 'ISO-8859-4' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s -skipfailures" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) encoding <- 'UTF-16' # encoding <- 'ISO-8859-4' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s -skipfailures" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) encoding <- 'UTF-16' # encoding <- 'ISO-8859-4' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s -skipfailures" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) encoding <- 'ISO-8859-4' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s -skipfailures" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) tbl_names[i] if(tbl_names[i] %in% c('Kirik_p')) encoding <- 'ISO-8859-4' else encoding <- 'UTF-8' cmd <- sprintf( paste0( "export PGCLIENTENCODING=%s; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING %s -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s -skipfailures" ), encoding, encoding, conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) styler:::style_selection() styler:::style_active_file() url <- "https://geoportaal.maaamet.ee/docs/muld" # Estonia shapefile (ZIP archive) map_shapefile <- "Mullakaart_SHP.zip" # Download and save url_download <- sprintf("%s", url) saveTo <- sprintf("%s/%s", tmp_dir, map_shapefile) url_download url <- "https://geoportaal.maaamet.ee/docs/muld/Mullakaart_SHP.zip" # Estonia shapefile (ZIP archive) map_shapefile <- "Mullakaart_SHP.zip" # Download and save url_download <- sprintf("%s", url) url_download saveTo <- sprintf("%s/%s", tmp_dir, map_shapefile) saveTo # Temp directory tmp_dir <- sprintf("%s/tmp/%s", system.file(package = "estmap"), "maaamet_mullakaart") if (!dir.exists(tmp_dir)) { dir.create(tmp_dir) } # Download link url <- "https://geoportaal.maaamet.ee/docs/muld/Mullakaart_SHP.zip" # Estonia shapefile (ZIP archive) map_shapefile <- "Mullakaart_SHP.zip" # Download and save url_download <- sprintf("%s", url) saveTo <- sprintf("%s/%s", tmp_dir, map_shapefile) saveTo file.exists(saveTo) # Unzip utils::unzip(saveTo, overwrite = T, exdir = tmp_dir) # List of files tmp_dir_kihid <- sprintf("%s/%s", tmp_dir, map_shapefile) ls <- list.files(path = tmp_dir_kihid, pattern = ".dbf") ls_long <- list.files(path = tmp_dir_kihid, pattern = ".dbf", full.names = T) tbl_names <- unlist(strsplit(x = ls, split = ".dbf")) tbl_names ls tmp_dir tmp_dir ls <- list.files(path = tmp_dir, pattern = ".dbf") ls ls <- list.files(path = tmp_dir, pattern = ".dbf") ls_long <- list.files(path = tmp_dir, pattern = ".dbf", full.names = T) tbl_names <- unlist(strsplit(x = ls, split = ".dbf")) tbl_names conf$schema <- "eesti" ruut::db_create_new_schema(conf = conf) length(tbl_names) i=1 print(tbl_names[i]) conf$table <- tolower(tbl_names[i]) source <- sprintf('"%s" "%s"', tmp_dir_kihid, tbl_names[i]) ## Export to postgis database. conf$primary_key <- "id" conf$s_srs <- "EPSG:3301" conf$t_srs <- "EPSG:3301" geometry_type <- "PROMOTE_TO_MULTI" cmd <- sprintf( paste0( "export PGCLIENTENCODING=UTF-8; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING UTF-8 -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) cmd system(cmd) print(tbl_names[i]) conf$table <- tolower(tbl_names[i]) source <- sprintf('"%s" "%s"', tmp_dir_kihid, tbl_names[i]) source conf$primary_key <- "id" conf$s_srs <- "EPSG:3301" conf$t_srs <- "EPSG:3301" geometry_type <- "PROMOTE_TO_MULTI" cmd <- sprintf( paste0( "export PGCLIENTENCODING=UTF-8; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING UTF-8 -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) cmd source source <- sprintf('"%s" "%s"', tmp_dir, tbl_names[i]) source('~/apps/R/packages/estmap/R/maaamet_mullakaart.R', echo=TRUE) source print(tbl_names[i]) conf$table <- tolower(tbl_names[i]) source <- sprintf('"%s" "%s"', tmp_dir, tbl_names[i]) ## Export to postgis database. conf$primary_key <- "id" conf$s_srs <- "EPSG:3301" conf$t_srs <- "EPSG:3301" geometry_type <- "PROMOTE_TO_MULTI" cmd <- sprintf( paste0( "export PGCLIENTENCODING=UTF-8; ", "ogr2ogr -progress --config PG_USE_COPY YES --config PGCLIENTENCODING UTF-8 -f PostgreSQL ", "PG:\" dbname='%s' host=%s port=%d user='%s' password='%s' ", "sslmode=%s active_schema=%s \" -lco DIM=2 %s -overwrite -nlt GEOMETRY ", "-lco GEOMETRY_NAME=geom -lco FID=%s -nln %s.%s ", "-s_srs %s -t_srs %s -nlt %s" ), conf$dbname, conf$host, conf$port, conf$user, conf$password, conf$sslmode, conf$schema, source, conf$primary_key, conf$schema, conf$table, conf$s_srs, conf$t_srs, geometry_type ) system(cmd) # Delete unnecessary files. system(sprintf("find %s -type f -not -name '%s' -print0 | xargs -0 rm --", tmp_dir, map_shapefile)) styler:::style_active_file() library(estmap) library(estmap) styler:::style_active_file() library(estmap) library(estmap) library(estmap) library(estmap) library(estmap)