0

I have seen various articles on how to get location information on WP7, such as Getting GPS coordinates on Windows phone 7.

On Android, there is an option to ask for Coarse location instead of Fine location. This is very useful for leaderboards etc as you only really care about the city that the user is in and not there exact whereabouts. And of course helps with provacy concerns. It basically gives you the location of the cell phone network.

Is there any such feature in WP7, to get Coarse location not fine? If not, is there any way to translate a fine location to a coarse one? I mean I can add 500m to the gps coordinate, but this may provide bad info if on a boundary, but this may be the way to go, not sure...

Any insight would be much appreciated!

Thanks

Community
  • 1
  • 1
swinefeaster
  • 2,525
  • 3
  • 30
  • 48

2 Answers2

2

You can alter the accuracy of the GeoCoordinateWatcher by changing its DesiredAccuracy property. You'd want to set it to Default instead of High (although, if you haven't changed it, it should be set to Default anyway).

keyboardP
  • 68,824
  • 13
  • 156
  • 205
  • How does this coarsify the quality of the gps data? – swinefeaster Jun 01 '11 at 17:22
  • The `Default` accuracy will use phone towers and wifi to gather your position. The `High` accuracy uses the built in GPS receiver. The latter is more accurate, but naturally uses more power whereas the former will give an approximate reading. – keyboardP Jun 01 '11 at 17:27
  • Looking at the docs, http://msdn.microsoft.com/en-us/library/system.device.location.geopositionaccuracy.aspx, they only indicate that Default will be used for power saving features. If another app is running, say a GPS tracking app that is using high accuracy GPS locations, would Default quality return the cell location or the exact location? (I don't have a WP7 device to test this out on...) Thanks! – swinefeaster Jun 01 '11 at 18:13
  • This is just a guess as I've never tried it, but the current WP7 doesn't support 3rd party multitasking. As such, once the other GPS tracking app is tombstoned/closed, its reference to the GPS will be lost. When your app creates a new GeoCoordinateWatcher, it will be set to the `Default` accuracy and return the approximate location and not the exact location. As I say, I haven't tried it, but that's how I'd imagine it would work simply because your app will be creating a new GCW and not reusing another app's one. (Happy to be corrected though :) ) – keyboardP Jun 01 '11 at 18:18
1

If you use the GeoCoordinateWatcher with Default accuracy the rest may be based solely on cell tower location. depending on where you are the cell tower may cover an area up to several km.

Regardless of the accuracy of the lat/long returned by the GCW you can convert this to an address (using the Bing Location API) and then use a part of the returned address (such as locality or Area District) as a coarse or approximate location.

Note that not every location maps to an address though.

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
  • That's a lot of lookups though. My current db scheme stores gps lat/lon values. There's no way of getting the gps location of the cell tower on WP7? Maybe I'll just do the arbitrary +500m or so solution to dumb down the fidelity... – swinefeaster Jun 01 '11 at 17:24