Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Satellite coordinates

From Wiki
Jump to: navigation, search
Article Metadata
Created: Den123 (01 May 2008)
Last edited: hamishwillee (07 Feb 2012)

The following code snippet demonstrates, how to obtain coordinates of the GPS satellites, that are used for determinate current device location. Class CPositionReader can be used for obtaining coordinates of the satellites. You should:

  • implement interface MPositionReaderObserver in your class
  • include CPositionReader* iReader as a class member
  • activate request:
iReader = CPositionReader :: NewL( this ); // new reader
iReader->ReadSatelliteInfo(); // request satellites info

And process results of reading:

void YourClass :: ReadingComplete( TPositionInfoBase& aPosInfo )
TPositionSatelliteInfo& info = ( TPositionSatelliteInfo& )aPosInfo;
for( TInt i = 0; i < info.NumSatellitesInView(); i++ )
TSatelliteData satData;
info.GetSatelliteData( i, satData );
if( satData.IsUsed() )
TReal azimuth = aSatData.Azimuth(),
elevation = aSatData.Elevation();

The coordinates of the satellites ( azimuth and elevation ) are presented in spherical coordinates system. This image demonstrates that indicate these coordinates:


And these formulas can be used for transform spherical coordinates to the coordinates in cartesian system:

x =  cos( Azimuth ) * cos( Elevation ) * Radius;
y = sin( Azimuth ) * cos( Elevation ) * Radius;
This page was last modified on 7 February 2012, at 05:27.
46 page views in the last 30 days.