Namespaces
Variants
Actions

Satellite coordinates

Jump to: navigation, search
Article Metadata

Article
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:

SphereCoords.PNG

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 08:27.
128 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved