We help IT Professionals succeed at work.

UK postcodes

sunny-j asked
Greetings Experts,

I have a database table with postcodes and am starting to look at how I can sort them onto a google map or similar to show the location by region of each facility (80,000+ locations) At the moment the table just has a postcode column, no lat/long details.  I am using SQL Server 2014, as well as Visual Studio 2017 and usually create solutions within c# and MVC.

Any guidance on tools out there or the approach i should take much appreciated.

Kind regards.
Watch Question

Most Valuable Expert 2018
Distinguished Expert 2019

Google Maps offers a GeoCode API which would allow you to pass in a Postcode and retrieve a Geographic Location (Lat/Long) that you could then place on your Map.

As a starting point, have a read up on the official docs: https://developers.google.com/maps/documentation/geocoding/intro

Once you've got your head around the concepts, come back with any specific questions you have.
Pawan KumarDatabase Expert
Awarded 2016
Top Expert 2016

As per below site -

Google Maps API provides a geocoding feature, for finding the latitude and longitude of places or addresses; but it does not work for UK postcodes. This is thanks to Royal Mail who have a copyright on the data, and are very restrictive with their (expensive) licenses for it. "

Most Valuable Expert 2018
Distinguished Expert 2019
That info is from a post published 10 years ago. Not sure it's still accurate. I've had no problems getting the location info from Google's GeoCode based on a PostCode.

If you do find problems with it, then take a look at the API from https://postcodes.io/. You can use that to get the Lat/Lng from a postcode