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
39.3k12 gold badges52 silver badges94 bronze badges
asked Jul 20, 2017 at 13:02
1

1 Answer 1

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.

answered Jul 24, 2017 at 7:53
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.