Skip to content
Snippets Groups Projects
Commit 778737cb authored by Juliette Engelaere-Lefebvre's avatar Juliette Engelaere-Lefebvre
Browse files

Ajout commentaires dans get_data()

parent f04bc08a
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,7 @@ importer_data <- function(table = NULL, schema = NULL, db = "production", server
# on recupere la liste des noms de champs de la table et leurs caracteristiques
champs <- rpostgis::dbTableInfo(conn = con, name = c(schema, table), allinfo = FALSE)
# recupere-t-on des proprietes de dataframe R dans zz_r_df_def ?
if(DBI::dbExistsTable(conn = con, name = c(schema, "zz_r_df_def"))) {
def_table <- DBI::dbReadTable(con, c(schema, "zz_r_df_def")) %>%
dplyr::filter(.data$table_nm == table)
......@@ -107,10 +108,10 @@ importer_data <- function(table = NULL, schema = NULL, db = "production", server
}
# on distingue 3 cas : table geo, table de donnees chargee avec poster_data(), table de donnees chargees autrement
if(any(grepl("USER-DEFINED", champs$data_type))) {
if(any(grepl("USER-DEFINED", champs$data_type))) { # la signature des champs de geometry
data_sf <- sf::st_read(dsn = con, layer = c(schema, table))
if ("id_row__" %in% champs$column_name) {
if ("id_row__" %in% champs$column_name) { # on enleve le champ de cle primaire eventuellement cree
data_sf <- dplyr::arrange(.data = data_sf, .data$id_row__) %>%
dplyr::select(-.data$id_row__)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment