How to change the encoding setting for a spatialpolygon loaded in R without reloading it? Similar to the argument
encoding=UTF-8 when loading the file with
readOGR or similar to the drop-down setting in QGIS to change the encoding that QGIS uses to read the file. (I don't need to change the encoding of the file itself as it is saved, just able to read the characters correctly)
Also, what is the most efficient (fast) package/command to load large geodatabase .gdb files?
I have a very large geodatabase file that I want to read in R. Available here: https://www.donneesquebec.ca/recherche/fr/dataset/adresses-quebec, although I don't think the file is a problem. The documentation for the file states that it was in
"Le jeu de caractères sélectionné (le « code page ») est le Windows Latin-1 (windows 1252)"). However, the characters did not load properly with
latin1(RÃ©gionale vs. Régionale) and it turned out that
UTF-8 was the correct encoding. I had to reload the file each time to try a different encoding and given that the file is large, it was problematic because it look a long time.
#load layer from geodatabase with latin-1 readOGR(dsn=fgbd, layer="Reseau_routier", encoding="latin1", use_iconv=FALSE) #load layer from geodatabase with readOGR(dsn=fgbd, layer="Reseau_routier", encoding="UTF-8", use_iconv=FALSE)