The closest you can get is a GeoIP lookup or a trace route on a separate thread. Unfortunately, neither is 100% accurate. For example, my connection is tracked to Chicago, where the bulk of the US internet traffic goes through, but I am no where near Chicago. Some servers/routers support asking them what their location is, but then you are relying on information someone has entered, if at all.
Now, a lot of routers have names that can help give away their location, but since there's no real standard for naming routers, you'll need to find a database of decodings, or build your own through trial and error..
My major point is through all this that IP related filtering is entirely unreliable. Roja and I talk (on the boards) about this all the time.
Best way to handle web-adminable options
Moderator: General Moderators