Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geocode the address written in native language using English letters

Friends,

I am analyzing some texts. My requirement is to gecode the address written in English letters of a different native language.

Ex: chandpur market ke paas, village gorthaniya, UP, INDIA

In above sentence words like, "ke paas" --> is a HINDI word (Indian national language), which means "near" in English and "chandapur market" is a noun (can be ignored for conversion)

Now my challenge is to convert such thousands of words to english and identify the street name and geo code it. Unfortunately, i do not have postal code or exact address.

Can you any one please help here?

Thanks in Advance !!

like image 761
Adarsha Murthy Avatar asked Mar 20 '18 08:03

Adarsha Murthy


1 Answers

Google's geocode api supports Hindi, so you don't necessarily have to translate it to English. Here's an example using my googleway package (in R) specifying the language = "hi" argument.

You'll need an API key to use the Google API through googleway

library(googleway)

set_key("your_api_key")

res <- google_geocode(address = "village gorthaniya, UP, INDIA",
               language = "hi")

geocode_address(res)
# [1] "गोर्थानिया, उत्तर प्रदेश 272181, भारत"

geocode_coordinates(res)
#         lat      lng
# 1 26.85848 82.50099

geocode_address_components(res)
#   long_name short_name                                  types
# 1    गोर्थानिया      गोर्थानिया                    locality, political
# 2       बस्ती        बस्ती  administrative_area_level_2, political
# 3    उत्तर प्रदेश      उ॰ प्र॰  administrative_area_level_1, political
# 4       भारत         IN                      country, political
# 5    272181     272181                             postal_code
like image 81
SymbolixAU Avatar answered Oct 22 '22 07:10

SymbolixAU