how to get wifi hotspot's location?
I want to write an application that it can record the wifi hotspot's location we are accessing and display them in map. But the problem is - how do I get wifi hotspot's location? I think I c开发者_如何学运维an use the wifi signal to get the wifi hotspot's location, but it may not be very accuracy at first time. And if there is no other solution, I could record the location of GPS when access wifi hotspot at the first time.
You'll not be able to find the hotspots location and you'll not be able to determine the direction and distance from your current position to the actual hotspot.
The hotspots don't report their coordinates (my wifi box doesn't even know it's own geographical coordinates). Google captured hotspots during their streetview missions and used the results to triangulate the positions of wifi hotspots and other companies did the same to build up databases.
So to get the information, you'll need access to a database that knows the coordinates of hotspots.
TL;DR
Such services (1, 2) and apps exist and you can just be downloaded and/or readily used.
Technical possibilities of localization
A very rough localization is possible via the IP address. This technically (and not always) only allows you to find the location of the ISP through which the internet is accessed, not the AP/hotspot itself (since a certain IP address pool is assigned to a given ISP). However, unless a VPN is used, that will usually at least tell you the country and often be even accurate to less than 50km (since ISPs are usually somewhat close to the internet access node). Many readily avaiable services are available for this, simply searching for something along the lines of "ip to location API free" should yield good results.
As you thought yourself, and as other answers already mentioned (in vague terms), there is however a better (or at least additional) option. You could just use the many devices out there to record the received WiFi signals and associate the strength of the signal with locations. With such a database, you could then in turn located devices, based on the received signals. Actually there are several such services, most prominently the one created by google and used (and fed with data by) pretty much any android phone out there. Fortunately, some of these are open and free to use (and contribute to), such as the one provided by mozilla, and another one.
Cell towers (and according databases) often allows localization down to tens or hundreds of meters.
In some places dedicated bluetooth APs are used to increase localization accuracy, especially indoors.
If you have a lot of time (several hours to days) and a more-or-less accurate time, you can also use the light (from sun and moon) to get a location. Even with the simplest means you can get down to a few dozen kilometers.
Watching the inclination of geomagnetic field against center of gravity in combination with an according dataset (very inaccurate, but cheap).
Of course dedicated satellite navigation systems such as GPS (~5m), BeiDou (10m~10cm), Galileo (1m~1cm), GLONASS (7~3m), where the lower numbers in the brackets are commercial/military only-systems. However, each of these require dedicated receivers.
These satellite navigation systems are often augmented by Ground Based Augmentation Systems (GBAS), which require additional receivers.
So now you can pick and chose for your application, which of these are most useful to you.
I don't think so. I use iPod touch maps and Samsung Galaxy Wonder as hotspot. iPod could tell my location! My guess is Samsung stealthily follow Apple's doing of communicate geo info through wi-fi.
精彩评论