I am having troubles with the encoding of the osm data in R. Here is a reproducible example using the osmar package:
I have also downloaded a planet file from https://download.geofabrik.de/europe/. The filename is "bulgaria-latest.osm.bz2". After unzipping it, installing osmosis, and reading the file with osmar::get_osm(source = osmsource_osmosis(fileName)) I still have the same issue. The cyrilics letters are not readable. I am using a 64bit Windows 10 with R version 3.3.3. My default encoding is Bulgarian, but I have also tried English encoding in R with no help. Any ideas how can I counter this? asked 21 Jul '17, 09:10 deann88 |
Ok, Answering my own question: I ran the above code in linux and understood that the issue was with the windows locale. The workaround I found was to use iconv with from and to parameters set to "UTF-8".
This works and could be applied to all columns. answered 24 Jul '17, 08:54 deann88 |
crossposted: https://stackoverflow.com/questions/45215553/issues-with-osm-encoding + https://gis.stackexchange.com/questions/248440/issues-with-osm-encoding
I suspect this is an issue you need to raise with the osmar package owner or R forums rather than here.
I have raised it to several places where people have worked with OSM as @scai pointed out. It is not package specific issue as I have tried it and it works in ubuntu. It is something connected with Windows locale and I am looking for a solution.
It's likely the issue is in the R console you are using. You could isolate whether it has anything to do with OSM and/or osmar by creating a simple test file and loading it with read.table.
Something like
should be sufficient.