google maps, cellid to location

Dels picture Dels · Oct 21, 2009 · Viewed 66k times · Source

According to this sample:

http://www.codeproject.com/KB/mobile/DeepCast.aspx

It's possible to request a gps coordinate (longitude & latitude) including range when sending cellid information (MCC, MNC, towerid, etc)

Can someone tell me the actual parameter to request/post to this address?

http://www.google.com/glm/mmap

It could be something like this

http://www.google.com/glm/mmap?mcc=xxx&mnc=xxx&towerid=xxx

And i would like to know what response we would get.

I have observe OpenCellid website and they provide some nice API to begin with, but i want to know about that in google map too (since they have more completed database).

OpenCellID API

Answer

Lairsdragon picture Lairsdragon · Mar 20, 2010

You could use the Google Location API which is used by Firefox (Example see at http://www.mozilla.com/en-US/firefox/geolocation/ ) which has the url www.google.com/loc/json/. In fact this is JSON based webservice and a minimal Perl Example Look like this:

use LWP;

my $ua = LWP::UserAgent->new;
$ua->agent("TestApp/0.1 ");
$ua->env_proxy();

my $req = HTTP::Request->new(POST => 'https://www.google.com/loc/json');

$req->content_type('application/jsonrequest');
$req->content('{"cell_towers": [{"location_area_code": "8721", "mobile_network_code": "01", "cell_id": "7703", "mobile_country_code": "262"}], "version": "1.1.0", "request_address": "true"}');

# Pass request to the user agent and get a response back
my $res = $ua->request($req);

# Check the outcome of the response
if ($res->is_success) {
    print $res->content;
} else {
    print $res->status_line, "\n";
    return undef;
}

Please keep in mind that Google has not officially opened this API for other uses...