Geo Codes, Cities & Countries

๐Ÿ‘

NOTE:

This guide is intended for API clients, particularly those seeking a solution for retrieving Geolocations (Latitude & Longitude) for locations around the world.

Overview

To perform a GeoLocation-based search for a destination, it's essential to have accurate GeoLocation information available.

While there are multiple Location and GeoCoding APIs available in the market (as previously discussed in Google Maps API article), HSP provides a convenient solution for clients - by offering a pre-defined CSV file containing cities, countries, and locations worldwide.

When an end customer searches for a location name (i.e. New York), it's crucial to have the necessary details for initiating a Search Hotels request to HSP. This information should include the latitude, longitude, and a radius in meters specific to the chosen location.

While there is a plethora of geocoding and location APIs accessible (as mentioned in the Google Maps API article), this guide will primarily focus on covering fundamental aspects to assist you in retrieving the correct locations when initiating a Search Hotels request to HSP.

Data

At its core, the most fundamental step is to acquire and maintain a well-structured locations table.

With that in mind, HSP offers clients the convenience of downloading a readily available .csv file.

This file contains comprehensive data on cities worldwide and locations, including their corresponding geolocation coordinates (latitude and longitude), country codes, country names, time-zones, and more.

To download list of cities with Geo Codes - Click here.

๐Ÿ‘

NOTE:

The Locations data includes the following information:

Local Name - The local name of the location.
English Name - The English name of the location.
CountryCode - The country code (ALPHA-2 ISO).
Latitude - The geographical latitude coordinates.
Longitude - The geographical longitude coordinates.
TimeZone - The continent/time-zone information.
IATACode - Relevant for applicable locations.
Radius - Applicable for certain locations (in meters).

Handling the Data

When we refer to "Data Handling" - we are talking about setting up a service that functions as an auto-completion feature. This service, upon selecting a location, retrieves the required data.

Here's an illustrative scenario: Imagine an end customer searching for "New York".

In this case, the service would search for matching entries in the table, provide automatic suggestions, and upon selection, return the essential data (Mainly- Latitude, Longitude, and Radius for locations which this data is in place).

Examples

In this demonstration video, you can observe that when searching for location names, the auto-completion feature not only suggests matching locations but also provides the necessary data when a location is selected.

This combination allows the service to function as a location retrieval service, facilitating the retrieval and forwarding of geolocations based on the search criteria.

๐Ÿ‘

NOTE:

Establishing this service can serve as a valuable initial step, but it's important to recognize the multitude of GeoCoding and Places APIs accessible.

These APIs offer the potential to augment and optimize the development of such services, contributing to improved functionality and enriched locations data.