Google Map

Google Maps Geocoding API And Reverse Geocoding

خيارات السماسرة الثنائية على الانترنت In this post, we will look into the implementation of Google geocoding API and reverse geocoding API using Node. Google Map plays a major role in many websites and application so it is good to know about geocoding API.

What is Geocoding?

binäre optionen algorithmus Geocoding is used to convert the addresses into latitude & longitude coordinates and which can be later used pin location, or to put the place marker on the map.

go Please find the code example to find out latitude and longitude of Walt Disney.

http://mohsen.ir/?danilov=الخيارات-الثنائية-كندا-باي-بال var request = require("request"); var options = { method: 'GET', url: 'https://maps.googleapis.com/maps/api/geocode/json', qs: { address: 'Walt Disney World Resort, Orlando, FL 32830, USA', key: YOUR_API_KEY // Need to get API Key From Google }, }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });

site de rencontre gratuit a l'ile maurice The Output will be :

http://creatingsparks.com.gridhosted.co.uk/?endonezit=best-books-on-binary-options-trading { "results": [ { "address_components": [ { "long_name": "Walt Disney World Resort", "short_name": "Walt Disney World Resort", "types": [ "establishment", "point_of_interest" ] }, { "long_name": "Orlando", "short_name": "Orlando", "types": [ "locality", "political" ] }, { "long_name": "Florida", "short_name": "FL", "types": [ "administrative_area_level_1", "political" ] }, { "long_name": "United States", "short_name": "US", "types": [ "country", "political" ] }, { "long_name": "32830", "short_name": "32830", "types": [ "postal_code" ] } ], "formatted_address": "Walt Disney World Resort, Orlando, FL 32830, USA", "geometry": { "location": { "lat": 28.385233, "lng": -81.563874 }, "location_type": "GEOMETRIC_CENTER", "viewport": { "northeast": { "lat": 28.3865819802915, "lng": -81.5625250197085 }, "southwest": { "lat": 28.3838840197085, "lng": -81.56522298029151 } } }, "place_id": "ChIJ96XKNOZ-3YgRoPEc0B85Hqc", "types": [ "amusement_park", "establishment", "point_of_interest", "travel_agency" ] } ], "status": "OK" }

source link First, check the status of the response and if it is “ buy Lyrica usa OK” then access the data available in the response. Place_id available in the response can also be used with Google Places API to get more details.

follow API Key must be used while querying the Geocoding API and If you are not using Key you will be following error message. Status of the response will be “ motorrad kennenlernen OVER_QUERY_LIMIT“.

{ "error_message": "You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=_", "results": [], "status": "OVER_QUERY_LIMIT" }

mayne aspirin 100 mg tablets 112 So Please make sure you are using right API key for your application.

What is Reverse Geocoding?

purchase nizoral shampoo online Reverse Geocoding is the process of converting the geographic address into an address which can be understood by the human beings.

benzac gel acquista online Please find the code sample which converts lat&long into the physical address.

var request = require("request");

var options = {
   method: 'GET',
   url: 'https://maps.googleapis.com/maps/api/geocode/json',
   qs: { 
   latlng: '28.385233, -81.563874' 
   key: YOUR_API_KEY
   },
};

request(options, function(error, response, body) {
   if (error) throw new Error(error);

   console.log(body);
});

Response JSON will be

{
    "results": [
        {
            "address_components": [
                {
                    "long_name": "World Drive",
                    "short_name": "World Dr",
                    "types": [
                        "route"
                    ]
                },
                {
                    "long_name": "Orlando",
                    "short_name": "Orlando",
                    "types": [
                        "locality",
                        "political"
                    ]
                },
                {
                    "long_name": "Orange County",
                    "short_name": "Orange County",
                    "types": [
                        "administrative_area_level_2",
                        "political"
                    ]
                },
                {
                    "long_name": "Florida",
                    "short_name": "FL",
                    "types": [
                        "administrative_area_level_1",
                        "political"
                    ]
                },
                {
                    "long_name": "United States",
                    "short_name": "US",
                    "types": [
                        "country",
                        "political"
                    ]
                },
                {
                    "long_name": "32836",
                    "short_name": "32836",
                    "types": [
                        "postal_code"
                    ]
                }
            ],
            "formatted_address": "World Dr, Orlando, FL 32836, USA",
            "geometry": {
                "bounds": {
                    "northeast": {
                        "lat": 28.3889735,
                        "lng": -81.56731719999999
                    },
                    "southwest": {
                        "lat": 28.3829244,
                        "lng": -81.56944460000001
                    }
                },
                "location": {
                    "lat": 28.3859584,
                    "lng": -81.5683346
                },
                "location_type": "GEOMETRIC_CENTER",
                "viewport": {
                    "northeast": {
                        "lat": 28.3889735,
                        "lng": -81.5670319197085
                    },
                    "southwest": {
                        "lat": 28.3829244,
                        "lng": -81.5697298802915
                    }
                }
            },
            "place_id": "ChIJv4kdV0h-3YgRuZziQ4rv9Co",
            "types": [
                "route"
            ]
        }
    ],
    "status": "OK"
}

Based on the query string passed we will get the response, if we pass geographic location as input then we will receive physical location as output and vice versa.

As I said earlier API key is mandatory for accessing these API’s. However, these API key got their own limits. Based on the plan you have subscribed you can access geocoder API.

Standard and premium plan

You can select Plan of your choice and limit.