Geocoding is the process of converting addresses (postcodes or street names) into coordinates (latitude and longitude). These coordinates can then be displayed on a map.
Geocoding is most commonly used on websites that need to allow visitors to interact with a map. The users might be searching for a point of interest, or for a particular route to a specific destination. In any case, they will need to enter a starting location into a search bar. This can be an exact postcode or location.
How does geocoding work?
The example below uses the TravelTime API to show how geocoding works. The geocoding service can be integrated into any service. Please check the documentation here. Geocoding with this API is free - get an API key here.
The user enters a location into the search bar. The example below shows a starting location of Islington, London.
The geocoder then sends a geocoding request to convert the place name ‘Islington, London, England, United Kingdom’ into the corresponding geographic coordinates. The geocoder returns the response as a latitude and longitude, which can be displayed on a map.
The user could then enter a destination. The example below shows the postcode: N1 2UN.
Again the geocoder converts the postcode into coordinates. These coordinates are displayed on the map.
The journey time can then be calculated between the two places and the route displayed for the user. It is also possible to reverse geocode. Reverse geocoding is translating coordinates into an address.
To start using the free geocoder get a TravelTime API key.