Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have the Id and address of the customers( add1, add2,City, state, post, country i have concatenated all these to one),I need to get the latitude and longitude. However i have the data in the excel, i have the google api key.
How can I find the lat and long using this.
I have followed this blog
https://debruyn.dev/2015/geocoding-addresses-in-talend-open-studio-for-data-integration/
and used
https://maps.googleapis.com/maps/api/geocode/json?address= + ((String)globalMap.get("LocConcatOut.LOCATION_CONCAT_ADDRESS"))+"&key=YourAPIkey"
in tfileinputJSON but getting blanks.Please suggest if there is any other way
DATA in CSV example:
+++ gift I am nice today...
Select as Best if its 👌
Kind regards,
😷19.
Hi @Since 1995,
it's very easy, just use a tREST or tRESTClient, then parse the JSON response to get what you want
URL: https://maps.googleapis.com/maps/api/geocode/json?key={{key}}&address=123%20fake%20street%2C%20fake%20town%2C%20london
{
"results": [
{
"address_components": [
{
"long_name": "London",
"short_name": "London",
"types": [
"locality",
"political"
]
},
{
"long_name": "London",
"short_name": "London",
"types": [
"postal_town"
]
},
{
"long_name": "Greater London",
"short_name": "Greater London",
"types": [
"administrative_area_level_2",
"political"
]
},
{
"long_name": "England",
"short_name": "England",
"types": [
"administrative_area_level_1",
"political"
]
},
{
"long_name": "United Kingdom",
"short_name": "GB",
"types": [
"country",
"political"
]
}
],
"formatted_address": "London, UK",
"geometry": {
"bounds": {
"northeast": {
"lat": 51.6723432,
"lng": 0.148271
},
"southwest": {
"lat": 51.38494009999999,
"lng": -0.3514683
}
},
"location": {
"lat": 51.5072178,
"lng": -0.1275862
},
"location_type": "APPROXIMATE",
"viewport": {
"northeast": {
"lat": 51.6723432,
"lng": 0.148271
},
"southwest": {
"lat": 51.38494009999999,
"lng": -0.3514683
}
}
},
"partial_match": true,
"place_id": "ChIJdd4hrwug2EcRmSrV3Vo6llI",
"types": [
"locality",
"political"
]
}
],
"status": "OK"
}
Kind regards,
😷19.
+++ gift I am nice today...
Select as Best if its 👌
Kind regards,
😷19.
Thanks @not specified not specified