How does Google calculate my location on a desktop? - geolocation

Right this is confusing me quite a bit, i'm not sure if any of you have noticed or used the "my location" feature on google maps using your desktop (or none GPS/none mobile device). If you have a browser with google gears (easiest to use is Google Chrome) then you will have a blue circle above the zoom function in Google Maps, when clicked (without being logged into my Google Account) using standard Wi Fi to my own personal router and a normal internet connection to my ISP, it somehow manages to pinpoint my exact location with a 100% accuracy (at this moment in time).
How does it do it? they breifly mention it here but it doesn't quite explain it, it says that my browser knows where i am...
...i am baffled, how?
I am intrigued because I would love to integrate it in the future of my programming projects, just like some background understanding and it doesn't seem too well documented at the moment.

I am currently in Tokyo, and I used to be in Switzerland. Yet, my location until some days ago was not pinpinted exactly, except in the broad Tokyo area. Today I tried, and I appear to be in Switzerland. How?
Well the secret is that I am now connected through wireless, and my wireless router has been identified (thanks to association to other wifis around me at that time) in a very accurate area in Switzerland. Now, my wifi moved to Tokyo, but the queried system still thinks the wifi router is in Switzerland, because either it has no information about the additional wifis surrounding me right now, or it cannot sort out the conflicting info (namely, the specific info about my wifi router against my ip geolocation, which pinpoints me in the far east).
So, to answer your question, google, or someone for him, did "wardriving" around, mapping the wifi presence. Every time a query is performed to the system (probably in compliance with the W3C draft for the geolocation API) your computer sends the wifi identifiers it sees, and the system does two things:
queries its database if geolocation exists for some of the wifis you passed, and returns the "wardrived" position if found, eventually with triangulation if intensities are present. The more wifi networks around, the higher is the accuracy of the positioning.
adds additional networks you see that are currently not in the database to their database, so they can be reused later.
As you see, the system builds up by itself. The only thing you need is good seeding. After that, it extends in "50 meters chunks" (the range of a newly found wifi connection).
Of course, if you really want the system go banana, you can start exchanging wifi routers around the globe with fellow revolutionaries of the no-global-positioning movement.

It's a lot more simple that you think. You've signed into both your mobile and Chrome on your desktop using the same Google account. Google simply expect you will have your mobile with you most of the time. They take the location data from your phone and assume the location of your current desktop session is the same.
I proved this by RDPing into my Windows machine at home from work and checking Google maps remotely. It show my location as the same as Chrome on Linux at work.
If you don't have a mobile that is signed into Google then all they can do is lookup GeoIP data for the IP address assigned by your ISP. It will typically be wildly inaccurate.

They use a combination of IP geolocation, as well as comparing the results of a scan for nearby wireless networks with a database on their side (which is built by collecting GPS coordinates alongside wifi scan data when Android phone users use their GPS)

I've finally worked it out. The biggest issue is how they managed to work out what Wireless networks were around me and how do they know where these networks are.
It "seems" to be something similar to this:
skyhookwireless.com [or similar] Company has mapped the location of many wireless access points, i assume by similar means that google streetview went around and picked up all the photos.
Using Google gears and my browser, we can report which wireless networks i see and have around me
Compare these wireless points to their geolocation and triangulate my position.
Reference: Slashdot

According to Google Maps' own help:

Rejecting the WiFi networks idea!
Sorry folks... I don't see it. Using WiFi networks around you seems to be a highly inaccurate and ineffective method of collecting data. WiFi networks these days simply don't stay long in one place.
Think about it, the WiFi networks change every day. Not to mention MiFi and Adhoc networks which are "designed" to be mobile and travel with the users. Equipment breaks, network settings change, people move... Relying on "WiFi Networks" in your area seems highly inaccurate and in the end may not even offer a significant improvement in granularity over IP lookup.
I think the idea that iPhone users are "scanning and sending" the WiFi survey data back to google, and the wardriving, perhaps in conjunction with the Google Maps "Street View" mapping might seem like a very possible method of collecting this data however, in practicality, it does not work as a business model.
Oh and btw, I forgot to mention in my prior post... when I originally pulled my location the time I was pinpointed "precisely" on the map I was connecting to a router from my desktop over an ethernet connection. I don't have a WiFi card on my desktop.
So if that "nearby WiFi networks" theory was true... then I shouldn't have been able to pinpoint my location with such precision.
I'll call my ISP, SKyrim, and ask them as to whether they share their network topology to enable geolocation on their networks.

I know you can look up IP address to get approximate location, but it's not always accurate. Perhaps they're using that?
update:
Typically, your browser uses
information about the Wi-Fi access
points around you to estimate your
location. If no Wi-Fi access points
are in range, or your computer doesn't
have Wi-Fi, it may resort to using
your computer's IP address to get an
approximate location.

It is possible get your approximate locate based on your IP address (wireless or fixed).
See for example hostip.info or maxmind which basically provide a mapping from IP address to geographical coordinates. The probably use many kinds of heuristics and datasources. This kind of system has probably enough accuracy to put you in right major city, in most cases.
Google probably uses somewhat similar approach in addition to WiFi tricks.

So Google keep records of Wifi router location by using any cellphone
GPS that connected to that router when you use Google maps or
location on cellphone. then google knows every device that connected
to that Wifi router uses the same location.
when GPS off or no cellphone connected to router Google uses IP
geolocation

Related

Extracting amount of connected devices from a router

I'm looking for a way to extract information from a router, be it from the router directly, through command, or through the routers webpage. I need to extract the amount of connected devices in real time. This has to be sent somewhere, where it gets processed and can be fed into an arduino.
The project is a kind of installation where light reacts to the amount of connected devices to the network. So more devices connected make the light do something and less make it do something else.
Is this even possible?
Thanks in advance!
Usually this information could be obtained from router's administration web interface.
For example, I found screenshot of Cisco router web interface:
Look at the bottom of the image: where are a "Current clients" field with number of clients.
So, this page could be loaded programmatically and parsed for the needed value.
As you didn't specified your router model, or your programming language or any other details, I can't give your more specific solution.
My python isn't that good though. Is there anyway you can point me in the right direction as where to look for this. And the information is in another submenu so is this still possible?this is what my router interface looks like.

Accessing IP cameras with OpenCV

First of all you have to understand a bit about my background. I have never worked with IP cameras before, but I will have to access multiple IP cameras simultaneously with OpenCV very soon. Apart from that, my network knowledge is not that much good.
Now the question. I know OpenCV can access IP cameras using its URL with the help of VideoCapture. There are number of questions in StackOverflow as well. But, the IP address is something that can be changed by time to time, it is dynamic. So even in a IP cam, the IP will change by time to time. So if this is the case, does this mean every time you try to access the cameras with OpenCV, you have to find the IP address of the camera manually and change the URL in OpenCV as well? I do not need to access the cameras via the internet, accessing locally is fine, via Wifi or network cables. How can I set a fixed IP address/ URL so the OpenCV code has nothing to change every time?
PS: I navigated through lot of websites (sites from more than 5 result pages of Google search) but the answers given are either too old or not that much convincing. So I decided to walk into StackOverflow for the answer.
If you can use local network, then Yes, you should use fixed IP address....if the Camera SDK is compatiable with OpenCV this you dont have have to worry about this and you can call VideoCapture directly. Or, you could use the camera SDK to get frames directly and then copy these frames to opencv image format and use opencv. This should not be too complicated.
If your router has a DHCP reservation feature, simply tell the router to always give an IP camera a certain IP.
Thus when the camera polls the DHCP server when it connects to the network, it will automatically receive its reserved IP. Other clients without a reservation will simply receive a random IP like normal. You might even think about doing this for all your computers and devices; it's quick and easy.

Blackberry - GPS vs Geolocation - how to select the best?

Does Blackberry API provide any methods to determine which one, GPS or Geolocation is better in current situation (according to signal level, network bandwidth and any other environment properties)?
There's many, many different algorithms you could use to determine which is the optimal location mode to use.
A well-tuned algorithm would have to account for things like
how fast does your user need a location fix?
how accurate does the fix need to be? is it just being used to find nearby movie theatres, or is the fix used for navigation (which needs to be really accurate)?
which mobile carrier are you on? GPS results may be independent of the carrier, but other geolocation technologies will depend on the carrier, and their infrastructure (assuming you're using the cellular network, and not Wi-Fi)
is there any reason to need to limit network transmissions (e.g. for a metered data plan, where you are frequently updating the location)?
how important is battery usage?
which BlackBerry OS versions are you targeting?
I'm sure I'm missing some other factors, but hopefully you can see that it's not a simple problem that can be solved without knowing something about your app and network deployment.
Also, this kind of algorithm for BlackBerry (Java) apps has traditionally taken a lot of work to optimize. As such, many developers (or clients) would consider this a closely-guarded business secret. So, it might be hard to find someone to publish their algorithm (but it doesn't hurt to ask, right?).
That said, you might at least take a look at the BlackBerry Simple Location API, which is an open source implementation of a basic algorithm that selects between GPS and Geolocation modes (if you allow it to use both). From the Javadocs (for the Optimal mode):
Operates in both Geolocation and GPS mode based on availability. First fix is computed in Geolocation mode, subsequent fixes in
Standalone mode. However if Standalone mode fails, falls back to Geolocation mode temporarily until a retry is attempted in
Standalone mode after a certain waiting period has passed. See setRetryFactor(int).
For single fix calls to getLocation(int), Geolocation mode is used first with a fallback to
Standalone mode if Geolocation mode fails.
I see you're in Belarus, but I don't know where your clients, or users are. If they're in the US, you may also need to consider something like Nav Builder Inside for geolocation if your app will support the Verizon network.
Anyway, I know this probably isn't the answer you wanted, but maybe it's a start?

Exactly how accurate is IP Geolocation?

I'm setting up a iPhone tracking system for my friends, so they can submit their location to my website by their iPhone, anywhere, anytime - by WiFi or cellular data.
The website will use Google Maps for their coordination's so that my other friends can track where they are, however, it is the accuracy of the IP to coordinates to Google Maps is what I'm concerned about, exactly how accurate is it to use Google Maps that would track down the locations by an IP address?
I was thinking about 95%, but this was tested in a village which was quite fairly accurate, but what happens if it was in a city? Would this cause unaccurate locations?
Any kind help appreciated.
IP geolocation is really hit-or-miss, depending on both how the user's ISP assigns IPs and on the IP geolocation database you're using. For instance, I made a simple PHP script, IP2FireEagle, which looks up your IP. I found that the database kept placing me 10+ km to the west of where I really was. Updating my entry in Host IP wasn't the greatest, as it soon got reverted, presumably by someone also occasionally assigned that IP by my ISP! That being said, I found that Clarke has very accurate coordinates (not that this it's using IP geolocation per se but rather Skyhook's API and their WiFi geolocation database).
If it's a website for your friends and you know they have iPhones, I would suggest using its browser's support for navigator.geolocation.getCurrentPosition(). That is, get the location via Javascript and submit it to your server via an AJAX call. Even better since you want to use Google Maps, they give you a short tutorial on how get your friends' locations and then update a map.
Excerpt From:
http://www.clickz.com/822881
IP targeting has been around since the early days of ad serving. It's not very hard to write code that will strip the IP address from a request, compare it to a database, and deliver an ad accordingly. The true difficulty, as we shall see, is building and maintaining an IP database.
One of the first applications of information in an IP database was targeting to specific geographic regions. Most commercial ad management systems have IP databases that can make geographic targeting possible. However, there are a couple weaknesses in this method. The first (and biggest) problem is that, for various reasons, not all IPs can be mapped to an accurate location.
Take all the IPs associated with AOL users, for instance. Anybody who has seen a WebTrends report knows that all AOL users appear to be coming from somewhere in Virginia. This is caused by AOL's use of proxy servers to handle their web requests.
In the interest of saving space, we won't get into the reasons why AOL makes use of proxy servers. The important thing is that AOL does use them, and as a result, all its users appear to be accessing the web from Virginia. Thus, it is impossible to attach meaningful geographic location data to an AOL IP, and those IPs must be discarded from any database that wants to maintain a reasonable degree of accuracy.
Other ISPs and networks may use a method known as dynamic IP allocation for its users. In other words, a user might have a different IP address every time he visits the Internet. You can see how this might affect the accuracy of a database.
But the real difficulty in discerning geography from an IP address has to do with the level of specificity that a media planner might expect from this targeting method. The first few geo-targeted campaigns that I put together early in my career had to be accurate to the ZIP code level. This level of specificity is not practical via IP targeting.

precise geolocalization via IP

I tied the iPad the other day, and was amazed about the precision of the geo localization by ip. Actually there is this action against hunger in the world that shows you very precisely where the persons are located that have took part to this petition:
http://www.1billionhungry.org/meodai/impact/
I would like to integrate that in one of my projects.
I took a look at the source but i could not figure out how they did it. Can someone help me out? is there a web service for that?
What i am not looking for is a service that gives back the location of my ISP, i need the position of the actual IP
for example I'm situated in Fribourg, Switzerland my ISP is in zürich Switzerland. Most of those services give back the location of my ISP, the iPad or the link i have posted are giving me back a precise localization by the IP. (actually even the address is right)
Is the google map api doing this or are they using an other service?
They are using another service which uses wireless access points for geolocation. The same features can be accessed in some browsers using HTML5's geolocation API:
function do_something(lat, long){
alert(lat + ", " + long);
}
if (navigator.geolocation) {
/* geolocation is available */
navigator.geolocation.getCurrentPosition(function(position) {
do_something(position.coords.latitude, position.coords.longitude);
});
} else {
alert("I'm sorry, but geolocation services are not supported by your browser.");
}
The Google Gears plugin provides a similar API for those with non-supporting browsers who have the plugin installed.
Generally, the implementations of the geolocation API use wireless access points and cell towers for geolocation. If these are not available (i.e. the user is on a desktop without a wireless card, or there are no wireless access points nearby), they generally fallback to IP-based geolocation.
Here's a google search with lots of databases to download:
http://www.google.co.uk/#hl=en&q=ip+to+geo+database&aq=f&aqi=&aql=&oq=&gs_rfai=&fp=77130048d7e0701a
Edit: Here's one free to download
http://software77.net/geo-ip/
Precision is going to vary product to product, if you want higher accuracy you are going to have to pay for it.
Read this for an article on ipad's geolocation... it's not completely IP related as you might think. That's why you won't find a geolocation library that will do what you want, because those just map ip addresses to fixed locations.

Resources