Anyone have any experience of consulting some kind of mapping database that provides information about a 'location'?

For example, on online web shopping basket forms, the user can enter a zip code and their address is populated from that, usually only the house number is needed to fully determine an address.

On Ebay, it's possible to specify a radius from a location and presumably determine the roads/streets that lie within that radius, or whether a zip code is within that radius.

How is this achieved?