I am building a registration form. I would like to query how to get full address from a postal code.
This is what I intend to do.
- User key in postal code
- User click on button called “auto fetch”
- Full address get loaded in to text field.
Note: address need to be global.
I researched online and found out that this can actually be done in using Google Maps API, am I right? I am confused because what Google Maps API does with is latitude and longitude. How do I incorporate postal code in this?
What Jim and Mukul have said is correct.
In the UK for instance, a postcode is only a “routing instruction” which in the vast majority of cases is sufficient to identify the thoroughfare or dependent-thoroughfare. However, if coupled with a DPS (Delivery Point Suffix – which no consumer needs to know or should care about) it can identify an address, but this again won’t work in all cases since a major block of flats may have several flats with identical DPS’s.
In the UK it’s important to note that a postcode is a routing instruction for delivery purposes and (although it can be in some sense) isn’t technically a geographical location.
In terms of lat/lon to get an address, it depends on the accuracy of the data the system is based on, as some are only 100m, 50m, 25m, 10m etc… (so you might get a house in the street, or a house a couple of doors away etc…)
There are addressing solutions out there, that given a postal code will then return a list of known addresses (and also lat/lon coords for it (to a certain accuracy))… Some provide an online API which can be used – but the majority of those services are paid for, and some are actually quite expensive.