green granite,
You are correct - but I believe that this depends on the reverse DNS entry for the IP addresses, and this is not always provided by the ISP.
In my case, my IP address resolves (ping -a address) to:
cable.ubr02.mort.blueyonder.co.uk
The "mort" is Mortlake in W London, so that's as close as I can be located (without asking my ISP)*. I assume that a whois on the RIPE database will provide similar information.
These details are compiled by various organizations and then they sell access to their databases, which is probably the way these sites "locate" you.
There is a resource record in DNS for specifying geolocation data for a host, where the latitude, longitude and altitude are specified. However, I do not believe that type of record is widely used - and again, this is the ISP location, not you!
SD
*Actually, my public PPRuNe profile locates me closer than that, but that is not relevant!