This topic has not yet been rated Rate this topic

System.Device.Location Namespace

The System.Device.Location namespace allows application developers to easily access the computer's location by using a single API. Location information may come from multiple providers, such as GPS, Wi-Fi triangulation, and cell phone tower triangulation. The System.Device.Location classes provide a single API to encapsulate the multiple location providers on a computer and support seamless prioritization and transitioning between them. As a result, application developers who use this API do not need to tailor applications to specific hardware configurations.

The GeoCoordinateWatcher class supplies location data that is based on latitude and longitude coordinates. The CivicAddressResolver and ICivicAddressResolver types provide the ability to resolve from a coordinate location to a civic address. Additionally, the IGeoPositionWatcher(Of T) interface can be implemented to extend the types of location data that are supplied.

In Windows 7, all the System.Device.Location classes are fully functional if a location provider is installed and can determine the computer's location. On Windows 7 Starter Edition, the Default Location Provider that can be set in Control Panel is the only location provider that is supported.

Note   In versions of Windows prior to Windows 7, the following conditions apply:

  • All System.Device.Location objects that have constructors can be created, but the Status property will always have the value Disabled.

  • The location indicated by the Location property of Position will always be Unknown.

  • No location events will be raised.

  Class Description
Public class CivicAddress Represents a civic address. A civic address can include fields such as street address, postal code, state/province, and country or region.
Public class CivicAddressResolver Provides functionality for resolving a coordinate-based location to a civic address.
Public class GeoCoordinate Represents a geographical location that is determined by latitude and longitude coordinates. May also include altitude, accuracy, speed, and course information.
Public class GeoCoordinateWatcher Supplies location data that is based on latitude and longitude coordinates.
Public class GeoPosition(Of T) Contains location data of a type specified by the type parameter of the GeoPosition(Of T) class.
Public class GeoPositionChangedEventArgs(Of T) Provides data for the PositionChanged event.
Public class GeoPositionStatusChangedEventArgs Contains data for a GeoPositionStatusChanged event.
Public class ResolveAddressCompletedEventArgs Provides data for the ResolveAddressCompleted event.
  Interface Description
Public interface ICivicAddressResolver Provides a method that when implemented, resolves a latitude/longitude location to a civic address.
Public interface IGeoPositionWatcher(Of T) Interface that can be implemented for providing accessing location data and receiving location updates.
  Enumeration Description
Public enumeration GeoPositionAccuracy Specifies the requested accuracy level for the location data that the application uses.
Public enumeration GeoPositionPermission Indicates whether the calling application has permission to access location data.
Public enumeration GeoPositionStatus Indicates the ability of the location provider to provide location updates.
Did you find this helpful?
(2000 characters remaining)
Community Content Add
Annotations FAQ
hDrivers
I think adoption of these location APIs would come much quicker if the Microsoft OS Team would provide a generic location sensor driver that would allow users to hook up to Bluetooth receivers. TurboIRC has a version, but one that is integrated that would allow you to pick a COM Port and autoscan baud rates would allow most users to get up and going.
Location semantics
Location has semantics beyond what is covered in this package, which looks very specific to geographic location. Considering this is part of base class library of the framework, more thoughts should have been given to make it more generic. $0$0 $0 $0For example, a device can sense location of itself based on proximity to a radio device, bluetooth or Wifi triangulation in conjunction with certain Wifi implementation. Newer technologies (such as UWB) keep emerging everyday. These sensor technologies do not necessarily deal with geographic location but location sometimes just has semantic on driving specific business processes. I hope to see changes to this package to define mostly contracts and possibly default implementation with integrated GPS on Windows and mobile devices (CF)$0