Getting latitude and longitude without a GPS (Windows Mobile)
I wondering if there is a method to obtain latitude and longitude of my position without using a GPS.
I developing a Windows Form application for W开发者_运维技巧indows Mobile 5.0 and above, C# and .NET Compact Framework. I use GPS and Bing Maps to show the user position on a map but sometimes it'd imposible to determinate user position using GPS. I saw that Google maps (for example) can determinate the area of user could be.
How can I do that on my application?
Thank you!
Cell ID can be used to give a very rough geographical area; there is an open source effort to get this info, and various companies sell the info, and if you dig hard enough you might find the unpublished APIs that Google maps uses.
http://www.codeproject.com/KB/mobile/DeepCast.aspx, as linked in another post, demonstrates how to get the cell ID and send it to Google's unpublished API for resolution.
Seems like you can subscribe to GPS location change events:
private Gps _gps = new Gps();
private GpsPosition _currentPosition;
public void Start()
{
_gps.LocationChanged += new
Microsoft.Location.LocationChangedEventHandler(_gps_LocationChanged);
if (!_gps.Opened)
{
_gps.Open();
}
}
private void _gps_LocationChanged(object sender,
Microsoft.Location.LocationChangedEventArgs args)
{
_currentPosition = args.Position;
}
See this article for further details, and also details of how to get your location using cell towers:
Finding your location on a Windows Mobile device
If you have a GSM phone there are a few hacks you can perform using the Radio Interface Layer. One such this one on devex.com.
Yes even I wonder when GPS is not working (like when I'm inside office or a shopping mall) but Google Maps gives almost accurate position. I suspect it uses information provided by aGPS (Assisted GPS) servers to GPS. GPS systems on most mobile phones are also using this technology.
One mechanism could be to triangulate using mobile phone masts. If you can work out how far you are away from two or more known locations then you can calculate your position.
However, (and it's a big however), I don't know how you (as a developer) can:
a) get access to the location of all mobile phone masts in your locale
b) interrogate the masts to see which ones they are to look up in your database.
I believe this is how aGPS (as mentioned by TheVillageIdiot) works - but that's on a phone which will have access to this information.
google maps uses a service called "geolocation" to determine your position. this is done by analyzing the nearest WLAN access points. if this doesn't work or there are no WLAN access points, your ip is used.
further reading: http://apb.directionsmag.com/archives/6094-How-Google-Maps-uses-the-W3C-Geolocation-API-and-Google-Location-Services.html
精彩评论