diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eef26514..9196ce52 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # R specific hooks: https://github.com/lorenzwalthert/precommit repos: - repo: https://github.com/lorenzwalthert/precommit - rev: v0.4.3.9015 + rev: v0.4.3.9021 hooks: - id: style-files args: [--style_pkg=spaceout, --style_fun=spaceout_style] diff --git a/DESCRIPTION b/DESCRIPTION index 82b68e14..dcfe6bd0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: osmdata Title: Import 'OpenStreetMap' Data as Simple Features or Spatial Objects -Version: 0.3.0.9024 +Version: 0.3.0.9026 Authors@R: c( person("Joan", "Maspons", , "joanmaspons@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2286-8727")), diff --git a/R/features.R b/R/features.R index f4af96ba..72bc5077 100644 --- a/R/features.R +++ b/R/features.R @@ -157,7 +157,12 @@ tags_from_tables <- function (pg) { if (identical (names (i) [1:2], c ("Key", "Value"))) { res <- i [, 1:2] } else { - res <- do.call (rbind, strsplit (i [[1]], split = "=")) + # "Key" has value, generally "=*", but sometimes multiple + # entries separated by commas. + keys_i <- unlist (strsplit (i [[1]], ",")) + keys_i <- grep ("\\=", keys_i, value = TRUE) + keys_i <- gsub ("^\\s*|\\s*$", "", keys_i) + res <- do.call (rbind, strsplit (keys_i, split = "=")) res <- data.frame (res) names (res) <- c ("Key", "Value") }