Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get latitude & longitude by using address from google geocode API in Configure.IT API flow

How can I get latitude & longitude values by using address from below geocode API inside Configure.IT API flow.

https://maps.googleapis.com/maps/api/geocode/json?address=XXXXX&key=XXXXX

In below flow chart, before insert customer data I need to fetch lat & lng values and store those values into customer table.

enter image description here

like image 646
Simhachalam Gulla Avatar asked Jun 27 '17 07:06

Simhachalam Gulla


People also ask

How can I find latitude and longitude?

To find a location using its latitude and longitude on any device, just open Google Maps. On your phone or tablet, start the Google Maps app. On a computer, go to Google Maps in a browser. Then enter the latitude and longitude values in the search field — the same one you would ordinarily use to enter an address.

How do I find latitude and longitude without a GPS?

If you are located in the northern hemisphere, the latitude of your exact position can be determined using the pole star Polaris. Polaris is a bright star with a magnitude of 2 and can be easily seen with your naked eye. To determine your latitude, you will have to measure the angle between Polaris and your horizon.


2 Answers

ConfigureIT provides API Connector block for connecting to external datasources and fetching data. You need to insert API Connector block before INSERT_CUSTOMER_DATA block.

Follow the steps and example screenshots given below :-

1) Add an input parameter for supplying address.

enter image description here

2) Save your changes and in next step double-click API Connector block, to add in to your API configuration flow chart.

enter image description here

3) In API Connector block configuration dialog, select Custom for API Type

enter image description here

4) And then enter "https://maps.googleapis.com/maps/api/geocode/json" in API URL field and in input parameters section add and input parameter, address and link it to API input Parameter(we added in step 1) address and then click Save & Next to proceed to next step.

enter image description here

5) Now you need to set up API output. Enter test input and then for getting whole result from google api in result select Current Format and for specific part of the response, select Specific Result

enter image description here

6) Save all your API changes and then Execute to check the result

enter image description here

Hope this helps..

like image 169
Pratyusha Terli Avatar answered Oct 14 '22 06:10

Pratyusha Terli


https://maps.googleapis.com/maps/api/geocode/json?address=&key= You have to pass your Google service API key to above URL then you will get
the result in json format as:

{
   "results" : [
      {
         "address_components" : [
            {
               "long_name" : "Mumbai",
               "short_name" : "Mumbai",
               "types" : [ "locality", "political" ]
            },
            {
               "long_name" : "Maharashtra",
               "short_name" : "MH",
               "types" : [ "administrative_area_level_1", "political" ]
            },
            {
               "long_name" : "India",
               "short_name" : "IN",
               "types" : [ "country", "political" ]
            },
            {
               "long_name" : "400093",
               "short_name" : "400093",
               "types" : [ "postal_code" ]
            }
         ],
         "formatted_address" : "Udyog Sarathi, Mahakali Caves Road, Marol Industrial Area, Andheri East, Mumbai, Maharashtra 400093, India",
         "geometry" : {
            "location" : {
               "lat" : 19.1254233,
               "lng" : 72.8665118
            },
            "location_type" : "GEOMETRIC_CENTER",
            "viewport" : {
               "northeast" : {
                  "lat" : 19.1267722802915,
                  "lng" : 72.86786078029151
               },
               "southwest" : {
                  "lat" : 19.1240743197085,
                  "lng" : 72.8651628197085
               }
            }
         },
         "place_id" : "ChIJ02N9eyPI5zsRMEB_9ivO_B0",
         "types" : [ "establishment", "point_of_interest" ]
      }
   ],
   "status" : "OK"
}

The geometry contains location as lat lon format.

like image 22
user2828296 Avatar answered Oct 14 '22 06:10

user2828296