Maxmind offers free databases to do IP localization :
http://dev.maxmind.com/geoip/legacy/downloadable/
It's not extremely precise, but is enough for applications like this. Notice for instance the point up north in Canada, a lot of IPs will be placed there. It's in the middle of Manitoba, and there's pretty much nothing there. I believe it's the geographical center of Canada, and the default value when no other coordinates are known.