Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
since_1995
Contributor III
Contributor III

Find Latitude and longitude

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:

0695b00000SqZHDAA3.png

Labels (3)
1 Solution

Accepted Solutions
Covid19
Creator
Creator

+++ gift I am nice today...

0695b00000SqbC5AAJ.png0695b00000SqbDmAAJ.png0695b00000SqbEkAAJ.png

0695b00000SqbAJAAZ.pngSelect as Best if its 👌

Kind regards,

😷19.

View solution in original post

3 Replies
Covid19
Creator
Creator

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

0695b00000SqaAXAAZ.png{

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

 

Covid19
Creator
Creator

+++ gift I am nice today...

0695b00000SqbC5AAJ.png0695b00000SqbDmAAJ.png0695b00000SqbEkAAJ.png

0695b00000SqbAJAAZ.pngSelect as Best if its 👌

Kind regards,

😷19.

since_1995
Contributor III
Contributor III
Author

Thanks @not specified not specified​