Tuesday, 5 February 2008

Locate Me Using GSM Information and Yahoo Services

Some mobile devices contains GPS (Global Positioning System) hardware using it you can acquire your location on earth in the form of longitude and latitude.

Additionally, most GSM cell towers have fixed locations (some of the towers are mobile ones) and have its own longitude and latitude location defined on it. So, depending on GSM network for acquiring handset location (longitude/latitude) is obvious solution instead of GPS hardware.

Yahoo provides two services API using them you can get GPS location (latitude and longitude) and use it in any maps service (google, yahoo, etc) from GSM network information.

1) ZoneTag. The cell location web service allows you to access the ZoneTag Location Services and get the best known location (address) for a given GSM cell tower ID.
All you need to do is requesting this service API by sending your GSM information in its URL as parameters. Response will be location address for the given cell information. ZoneTag learns about real world cell locations from users.
The required GSM information for the service API is; cell id, mcc (Mobile Country Code), mnc (Mobile Network Code) and lac (Location Area Code).

2) Geocoding API. The Geocoding Web Service allows you to find the specific latitude and longitude for an address. All you need is sending your address (country, city, state, street and zip code) in the request URL and then you will get XML response contains the GPS information.

Example:
Given the following cell information: cell id=48627, lac=201, mnc=15, mcc=234, request URL is:
http://zonetag.research.yahooapis.com/services/rest/V1/cellLookup.php?ap...
Response XML will be :


<rsp stat="ok">
<Location>
<Country cell="current" source="user">United Kingdom
</Location>
<Location>
<Country cell="current" source="generic">United Kingdom
<City cell="current" source="generic">Hammersmith
</Location>
<Location>
<Country cell="current" source="GPS">United Kingdom
<City cell="current" source="GPS">London
<Zipcode cell="current" source="GPS">W6 8
</Location>
</rsp>

From the given address you can request Geocoding service API to get GPS location:
http://local.yahooapis.com/MapsService/V1/geocode?appid=YahooDemo&countr...
Response XML will be:

<ResultSet xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd">
<Result precision="zip">
<Latitude>51.506325
<Longitude>-0.127144
<Address/>
<City>London
<State>United Kingdom
<Zip/>
<Country>GB
</Result>
</ResultSet>
http://local.yahooapis.com/MapsService/V1/geocode?appid=YahooDemo&countr...

I found that the returned GPS location is (long=29.889870, lat=31.192240). I think it is the marked point by Yahoo for Alexandria in Yahoo maps.
For anyone interested to test this services in Egypt, Vodafone mcc=602 and mnc=02 as example.

1 comment:

Unknown said...

VERY GOOD INFO..THANK U SO MUCH, FINALLY UNDERSTOOD SOMETHING ABT SPRING FRAMEWORK WITH RESTlet services....

I have a request, please can u provide one complete and simple example with implementation classes also with spring and RESTlet.. thanks in advance