| Reply | « Previous Thread | Next Thread » |
|
Hi,
I am writing an application that uses the cell phone's location data. I have a T-Mobile voice plan, but no data plan. I am using a Nokia with which I can successfully obtain a CellID [location.gsm_location()]. However, I am unable to turn this into a specific location (gps coordinates or an address). Has anyone been successful in retrieving coordinates with a similar setup (voice plan, no data plan) and could suggest some API that would do this for me? Any suggestions would be much appreciated! Thanks in advance. |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
Well, I think you can do this. Please take a look at this article, it might help you. BR, Rafael.
Last edited by Rafael T. : 2008-10-30 at 01:43.
|
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Online
Forum Nokia Champion
|
|
Hi mango7
The thing goes like this if you want to get the location then you have to use GPS to get the perfect lat/long. You cant map location perfectly using the cellid method. For more details you can have a look at he MopyMaps example in the mobile python book. Enjoy pythoning Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Quote:
The article explain only about getting cell id, mcc, mnc and lac. But using this data you cant get exact location. I think gaba88 is correct, you have to use gps to get exact lat-long. Bye. Jajal Mehul |
|
@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)
Python-Stuff I work on @ http://www.daniel-perna.de/Python.htm
Last edited by szallah : 2008-10-30 at 12:57.
|
|
You'll find all you need to know here. http://foreverneilyoung.blogspot.com...here-am-i.html
I didn't had a trigger to port my C# sample to python, but I thought I could make it and embed the code into my LocateMe http://discussion.forum.nokia.com/fo...d.php?t=148748 What do you think? |
| neil.young |
| View Public Profile |
| Find all posts by neil.young |
|
Hello,
I have found something that may be useful here: http://blog.jebu.net/2008/07/google-...python-on-s60/ Works very good, ass long as your cell ID is in database. I have tested it mainly in Denmark, where 90% of towers are accessible. In Poland and Germany it is much worse. I am wondering how it is in different countries. If anyone will be making some tests I will be very much interested in results. You can contact me at maclun@gmail.com. Maciej |
|
Quote:
Also Yahoo's Fire Eagle is probably offering cell tower database too. Mikko Ohtamaa Twinapex Research http://www.twinapex.com |
|
Simply you are not allowed to use it that way
![]() |
| neil.young |
| View Public Profile |
| Find all posts by neil.young |
|
Quote:
In contrary to your claim the hit rate in Germany is extremely good. The problem: Google is (or at least was last time I used this API) faulty with its handling of UMTS towers. Because Germany is full of 3G towers, you are likely lost, if you ask them for geocodes for UMTS cells. But taken that error into account, you may come to a result. I have blogged in details on this issue, and as far as I can see, the python code doesn't take the UMTS problem into account.... Regards |
| neil.young |
| View Public Profile |
| Find all posts by neil.young |
|
|
|
Hey, szallah, this script gives wrong coordinates if they are negative (e. g. try MCC=310, MNC=410, LAC=11946, CID=6559), must me something like this:
Code:
def convert_bytestring(response):
lathex_s = response[14:22]
lonhex_s = response[22:30]
negative_threshold = 0x7fffffff
lat = int(lathex_s,16)
lon = int(lonhex_s,16)
if lat > negative_threshold:
lat = -(1 + negative_threshold - (lat & negative_threshold))
if lon > negative_threshold:
lon = -(1 + negative_threshold - (lon & negative_threshold))
lat = float(lat)/1000000
lon = float(lon)/1000000
return (lat,lon)
Quote:
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Location Estimation based on Multiple BTS Cell IDs | hU | Symbian Networking & Messaging | 3 | 2009-06-09 16:57 |
| cell id and location area code | vvsnaresh | General Symbian C++ | 5 | 2009-01-04 13:55 |
| Cell information-Cell id & location string | mayankkedia | Symbian Networking & Messaging | 5 | 2008-08-06 18:33 |
| Location Estimation based on Multiple BTS Cell IDs | hU | General Symbian C++ | 0 | 2007-10-07 07:42 |
| cell id - location | gheese | Symbian Networking & Messaging | 0 | 2003-07-24 11:18 |