ropenstreetmaptmaposmdata

Umlaute not displayed correctly with osmdata


I am having troubles with the German Umlaute (ä, ü, ö) and other signs when using osmdata in R.

I can successfully get the data via query (notice the Ü in the bounding box in the first line, it is working fine):

#install.packages("osmdata")
#library(osmdata)

bw <- osmdata::getbb("Baden-Württemberg") %>% 
  osmdata::opq(timeout = 25*100) %>%
  osmdata::add_osm_feature(
    key = "admin_level", 
    value = "4"
  ) %>%
  osmdata::osmdata_sf()

Having a look at the data, one can see that the umlaute aren't displayed correctly.

View(bw$osm_multipolygons)

Consequently, searching by "name" doesn't work anymore:

dplyr::filter(bw$osm_multipolygons, name == "Tirol")
dplyr::filter(bw$osm_multipolygons, name == "Baden-Württemberg")

Tirol is working (no umlaut), Baden-Württemberg (with the ü) isn't.

I'm running R on a German Windows 10, R is running in English.

Best regards


Solution

  • The current working solution for me is described here:

    Importing Open Street Map data gives wrong encoding

    It is really annoying because a) I am using a function which I don't understand b) it seems to work for other people (@mrgrund)

    on the other side, it seems I am not the only person with the problem.

    Best regards