wiki <- readr::read_csv(here::here("data-raw/result.csv"))
New names:
* `` -> ...1
Rows: 500 Columns: 13
── Column specification ──────────────────────────────────────────────────────────────
Delimiter: ","
chr (13): ...1, Category, Geolocation, City, Managed by, Used by, Software Deploye...

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
geo <- wiki |>
  janitor::clean_names() |>
  select(geolocation) |>
  filter(!is.na(geolocation))

Prepare

dms_to_decimal <- function(input) {
  sp::char2dms(input, chd="d", chm="m", chs="s") |> as.numeric()
}
geo <- geo |>
  head(10) |>
  mutate(geolocation = toupper(geolocation),
         geolocation = str_replace_all(geolocation, '°', "d"),
         geolocation = str_replace_all(geolocation, "'", "m"),
         geolocation = str_replace_all(geolocation, '"', "s")) |>
  mutate(geo_split = stringr::str_split(geolocation, ",")) |>
  rowwise() |>
  mutate(lat = dms_to_decimal(geo_split[1]),
         long = dms_to_decimal(geo_split[2]))
LS0tCnRpdGxlOiAiUiBOb3RlYm9vayIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKYGBge3J9Cndpa2kgPC0gcmVhZHI6OnJlYWRfY3N2KGhlcmU6OmhlcmUoImRhdGEtcmF3L3Jlc3VsdC5jc3YiKSkKZ2VvIDwtIHdpa2kgfD4KICBqYW5pdG9yOjpjbGVhbl9uYW1lcygpIHw+CiAgc2VsZWN0KGdlb2xvY2F0aW9uKSB8PgogIGZpbHRlcighaXMubmEoZ2VvbG9jYXRpb24pKQpgYGAKCiMjIFByZXBhcmUKCmBgYHtyfQpkbXNfdG9fZGVjaW1hbCA8LSBmdW5jdGlvbihpbnB1dCkgewogIHNwOjpjaGFyMmRtcyhpbnB1dCwgY2hkPSJkIiwgY2htPSJtIiwgY2hzPSJzIikgfD4gYXMubnVtZXJpYygpCn0KZ2VvIDwtIGdlbyB8PgogIGhlYWQoMTApIHw+CiAgbXV0YXRlKGdlb2xvY2F0aW9uID0gdG91cHBlcihnZW9sb2NhdGlvbiksCiA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