@mango7
i once made a script that gathers the lat/lon google-maps assigns to cell-towers. there are far from accurate, but correct within a radius of +/- 2 kilometers... the script also is in use in pynetmony (http://discussion.forum.nokia.com/fo...d.php?t=114522)...
i'll post the script when i'm back from work...
EDIT
here's the quick-and-dirty script. this one doesn't work with PyS60 since there's no urllib2 in PyS60. but it can be done using the the normal urllib and it'll give you a hint how it works...
anyhow, this just works if google has data for the cell-tower you're trying to lookup...
Code:
import urllib2
url = 'http://www.google.com/glm/mmap'
string1 = '000E00000000000000000000000000001B0000000000000000000000030000'
string2 = 'FFFFFFFF00000000'
def make_string(value):
hex_s = hex(value)[2:]
return hex_s.zfill(8)
def fetch_latlon(bytestring):
global url
user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
headers = { 'User-Agent' : user_agent }
req = urllib2.Request(url, bytestring, headers)
resp = urllib2.urlopen(req)
response = resp.read().encode('hex')
return response
def convert_bytestring(response):
lathex_s = response[14:22]
lonhex_s = response[22:30]
lat = float(int(lathex_s,16))/1000000
lon = float(int(lonhex_s,16))/1000000
return (lat,lon)
def main(cid,lac,mnc,mcc):
global string1, string2
string = string1+make_string(cid)+make_string(lac)+make_string(mnc)+make_string(mcc)+string2
b_string = string.decode('hex')
bytes = fetch_latlon(b_string)
(a,b) = convert_bytestring(bytes)
print a
print b
CID = 20465
LAC = 495
MNC = 3
MCC = 262
main(CID,LAC,MNC,MCC)