2

I am having troubles with the encoding of the osm data. Here is a reproducible example using the osmar package:

 osmData <- osmar::get_osm(osmar::center_bbox(23.334360, 42.693180, 100, 100))
 osmData$nodes$tags[80:100, ] #the output is not UTF-8

I have also downloaded a planet file from https://download.geofabrik.de/europe/

After unzipping it and using it with osmar::get_osm I still have the same issue. The cyrilics letters are not readable.

Any ideas how can I counter this?

www
  • 38,575
  • 12
  • 48
  • 84
deann
  • 756
  • 9
  • 24
  • crossposted: https://gis.stackexchange.com/questions/248440/issues-with-osm-encoding + https://help.openstreetmap.org/questions/57219/issues-with-osm-encoding-in-r – scai Jul 21 '17 at 09:26

1 Answers1

2

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".

iconv(osmData$nodes$tags[80:100,3][11], from="UTF-8", to="UTF-8") 

This works and could be applied to all columns.

deann
  • 756
  • 9
  • 24